Closed eatyourgreens closed 2 years ago
When I sign out on the PH TESS Classify page, then sign back in again, the UPP loading state is initially 'success' when it's first checked by the tutorial, while the UPP itself is undefined. When the loading state is 'success', the tutorial should always open for a logged-out user, so that could be where the bug is.
I gave this bug about an hour of time this morning, without getting anywhere useful. I'm going to have to put it down to focus on British Library work.
When I sign out in the project app, that change doesn't seem to be passed down to the classifier. 🤔
Here you can see that the classifier key, which is the current user ID, does not change to no-user
after logging out.
The classifier key is set here, in the classifier wrapper: https://github.com/zooniverse/front-end-monorepo/blob/0b1232ce7371ddc54c07e92f448bd848660957a3/packages/app-project/src/screens/ClassifyPage/components/ClassifierWrapper/ClassifierWrapper.js#L86-L93
I've opened #2962 for that auth bug, and #2963 to fix it.
Signing out (#2962) is a different bug from this one. I can reliably reproduce this bug if I log in when UPP.loadingState
is set to 'success' in the classifier.
I'm not sure what the best approach to tackle this bug is. If you start to sign in, should we reset the user state to 'initialised'?
I’ve got a fix for this, but it involves a change to loadingState
for all the resource stores in the classifierStore
tree. I’ll hold off on opening a PR until I’m happy with that change.
Re-opening this because the bug has appeared again on staging. https://frontend.preview.zooniverse.org/projects/nora-dot-eisner/planet-hunters-tess/classify/workflow/11235
Package
lib-classifier
Describe the bug
On a project like PH TESS, where I've already seen the tutorial, the tutorial will still open if I log in after the
Classifier
store has been created.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The tutorial should only open if I haven't seen it before.
Additional context
When you sign in,
upp.loadingState
should be reset, while your preferences load, so thattutorial.hasNotBeenSeen
returns false here: https://github.com/zooniverse/front-end-monorepo/blob/afddbb4683c5664eea33d6889257316d5f5b5f11/packages/lib-classifier/src/store/TutorialStore/Tutorial/Tutorial.js#L21-L23If the UPP loading state is still set to 'success', from the initial user check when the classifier mounted, then
tutorial.hasNotBeenSeen
will be true while your preferences load, which will then trigger the tutorial to open.