-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix(lib-classifier): expire classification session IDs #6504
Conversation
d4fabee
to
d70275b
Compare
- fix the session ID tests so that they fail properly. - fix `getSessionID` to pass the tests. - refresh the session TTL whenever an annotation is updated.
- fix `stored.ttl` so that dates are compared as `Date` objects. - refactor `generateSessionID` to return a session ID. - update tests for `generateSessionID`.
2ea1353
to
a2e4e9c
Compare
const { authClient } = getRoot(self) | ||
authClient?.checkBearerToken() |
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.
These lines are left over from when I was debugging expired auth sessions in Beyond Borders, a long time ago. I forgot to remove them when I was finished.
398a6dd
to
e01ef0a
Compare
I'll take a look at the unit test strategy in this PR, but I'll be asking for review of #6499 instead of introducing new behavior to the classifier. Session ids have never refreshed after 5min of activity in the PFE classifier or the FEM classifier, so this PR would be changing the behavior after a decade of research. |
Superseded by #6499 |
getSessionID
to pass the tests, by expiring a session ID after five minutes of inactivity.generateSessionID
so that it generates a session ID.storedSession()
andnewSession()
functions, to make it a little clearer what the code is doing.store/utils/session.js
is now an ES module that can be copied straight into PFE. PFE and the monorepo both share the samesession_id
object in session storage, so the session code has to be synchronised for both repo's.Please request review from
@zooniverse/frontend
team or an individual member of that team.Package
Linked Issue and/or Talk Post
How to Review
All classifications made in a single session should still have the same session ID here. The difference from #6499 is that a new session ID should be generated if you do nothing for 5 minutes. It should be possible to record multiple classification sessions from a single browser session in the same tab.
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedGeneral UX
Example Staging Project: i-fancy-cats
Bug Fix