-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
…ing of includeNeverActive I'd like the default behavior to be -- without this filter never active users are not returned by the inactiveSince query left off working on unit tests -- incomplete state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked in a hack session about the desired semantics. Here are a few tips to get you further towards this. This should make the test easier to write as well now that we've clarified the misunderstanding.
internal/database/users.go
Outdated
// NeverActive filters out users that have never had an eventlog entry if true. | ||
NeverActive bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Rename
- Redocument to match graphql layer semantics
…ter -- TODO: create new unit Tests for both TestUsers_InactiveSince & TestUsers_IncludeNeverActive
cmd/frontend/graphqlbackend/users.go
Outdated
@@ -34,6 +35,9 @@ func (r *schemaResolver) Users(args *usersArgs) *userConnectionResolver { | |||
if args.InactiveSince != nil { | |||
opt.InactiveSince = args.InactiveSince.Time | |||
} | |||
if args.IncludeNeverActive != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also be nested under if args.InactiveSince != nil {
After exploring this a bit more I will need to review the logic and rename some variables that are named never active -- this is in light of the fact that users may have I still think having a filter here is going to come in handy though, in |
…e really indicates
Closing in light of: sourcegraph/src-cli#901 |
This PR is to add a sorting flag for returning users that have a null value for
lastActiveTime
or not. This user state may be caused by a user having never been active on the Sourcegraph instance, or having not been active for 93 days (this is the length of time entries in theevent_logs
table are persisted in the database)Test plan
Unit Tests