-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index user if not existed and log last active time for user accessing apis via backend apps #227
Conversation
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.
Commit 3 comments here first, still under review QQ
@@ -3,6 +3,7 @@ import client from 'util/client'; | |||
import CreateBackendUsers from '../createBackendUsers'; | |||
import fixtures from '../__fixtures__/createBackendUsers'; | |||
import { sortBy } from 'lodash'; | |||
jest.setTimeout(50000); |
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.
We may need to remove L8 to make this line work xd
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.
haha, good catch.
Actually, I think this might only be needed for tests to pass locally. It doesn't seem to timeout as easily on travis.
I am actually thinking, maybe we can make timeout value an environment variable to be set in .env and move this to setup since this is pretty much environment performance dependent (I don't know about everyone else, but they run way slower on my laptop than on travis :p)
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 it's OK that we increase timeout directly.
Increasing timeout does not impact time spent on test, but can save precious developing energy on problems that we can really solve.
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.
Thanks a million for looping in tests for index.js! This is the first time apollo server context logic can be included in tests. I am grateful for @ztsai 's integration effort 🙇♀️
I am a bit confused how Apollo server context could interact with other middlewares like checkHeaders
. We may need to check if the current logic works for web browser users.
Lastly, I have some nitpicking suggestions are regarding snapshot names :P
frontend users are tested with logging in from development frontend, and backend users are tested with
|
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.
LGTM! Thanks for the fix!
Added some nit-picking comments that should not be merge blockers. Feel free to adapt and merge anytime :)
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.
Thanks for the refactor! Let's merge this. I will try deploy it to staging before wednesday, along with data migration.
closes #220