-
Notifications
You must be signed in to change notification settings - Fork 29
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
Open
eatyourgreens
wants to merge
8
commits into
zooniverse:master
Choose a base branch
from
eatyourgreens:fix-session-id
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−87
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eatyourgreens
force-pushed
the
fix-session-id
branch
from
November 28, 2024 08:04
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`.
eatyourgreens
force-pushed
the
fix-session-id
branch
from
November 28, 2024 08:39
2ea1353
to
a2e4e9c
Compare
eatyourgreens
commented
Nov 28, 2024
Comment on lines
-37
to
-38
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.
eatyourgreens
force-pushed
the
fix-session-id
branch
from
November 28, 2024 13:21
398a6dd
to
e01ef0a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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