-
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
Upgrade mobx, mobx-react and mobx-state-tree #2009
Conversation
The last attempt to upgrade mobx-react broke classifications for live projects (#1839.) I'm hoping this will avoid that by installing the same version of mobx across the NextJS apps and the classifier. |
I'm not seeing a recurrence of #1839 when I submit empty classifications on this branch. |
cc6574a
to
60eade2
Compare
Should we upgrade |
UPP store model tests in the classifier are all broken, with mobx-state-tree > 3.15, because they don't wait for the UPP to load before running the expectations. 😞 EDIT: Classification works locally with MST 3.17. so I think the tests are the problem, not the store. The expectations run immediately after the project loads, but should wait for the user and UPP to load. This might be fixed by using |
2cdf2c2
to
72cf8bd
Compare
Update the NextJS apps and the classifier to each use [email protected] and [email protected]
Bump mobx-react to 6.3 and mobx-state-tree to 3.17 for the NextJS apps. Upgrading the classifier breaks the tests for the store models, so I've held off on that.
2da7a0f
to
7113e7c
Compare
return rootStore.userProjectPreferences.loadingState === asyncStates.success | ||
} | ||
when( | ||
preferencesAreLoaded, |
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.
This delays running the tests until preferencesAreLoaded()
is true.
Move duplicated code into a function. Run tests after the UPP has either loaded or errored, then check that the expected state is set.
39e02d6
to
dd3e4a4
Compare
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.
PR Review
Projects: app-project
lib-classifier
app-content-pages
This PR is a major dependency update for our app's stores.
- In general, testing looks good. I'm unable to break any of the main functionality of the app(s)
- I'm unable to replicate the error in mobx-react v.6.1.4 breaks classifications without annotations on the first subject #1839 - submitting a Classification with no annotations works fine. This is good 👍
Testing
Part 1: Tested app-project
on macOS10+Chrome88 on localhost:3000
Looking good:
- With a workflow with 1 Single Question Task, I'm able to...
- ...answer one question and submit.
- ...provide no answer and submit
- With a workflow with 2 Single Question Tasks, I'm able to...
- ...answer two questions and submit.
- ...answer one of the questions and submit.
- ...provide no answer and submit
- ...go back to a previous question to amend an answer
- With a workflow with 1 Drawing Task (Point tool, Point tool), I'm able to...
- ...add, edit, and delete Point marks.
- ...provide no marks and submit.
- ...provide 1-5 marks and submit.
- With a workflow with 1 Drawing Task (Point tool, Point tool), and 1 Text Task, I'm able to...
- ...add, edit, and delete Point marks.
- ...proceed to the Text Task, then go back to the Drawing Task to amend my earlier annotations.
⚠️ [minor quirk] there's an oddity where going back to a previous drawing task causes the previous annotations to STILL appear as untouchable "previous marks", but this is extant even inmaster
and not related to this PR. Probably a different bug to fix.
- ...provide any combination of answer/non-answers and submit
Additional testing on Safari12 and Win+Edge88 (but Edge is basically Chrome in a fancy hat at this moment so no surprise that there are no surprises here.)
Part 2: Tested lib-classifier
on local.zooniverse.org:8080
- Basic tests for lib-classifier looks fine.
- Based on passing tests in Part 1, I did not feel the need to test the lib-classifier alone too thoroughly.
Part 3: Tested app-content-pages
on macOS10+Chrome88 on localhost:3000
- Content pages loaded fine and functioned normally.
Testing Limitations
- I'm unable to test authentication/login on
app-project
on Chrome due to issues accessinghttps://local.zooniverse.org:3000
on my end. (Chrome spews SSL errors for my pseudo-localhost)- On Safari (which is far more permissive with SSL infractions), however, I can confirm that auth/login works fine, for what that's worth.
Status
This PR looks good to me. 👍
I just realised you opened #2011 precisely for this. Reviewing that now! |
Update the NextJS apps to use [email protected], [email protected] and [email protected].
Upgrade the classifier to use [email protected], [email protected] and [email protected].
Upgrading mobx-react to 6.3 breaks the classifier tests, so I've left it alone for now.
Rewrite the project preferences store tests to use
mobx.when
. Previously, the tests were run without waiting for the project preferences to load, which broke in mobx-state-tree 3.16 and higher.Also fixes a couple of project preferences tests which were accidentally nested inside another test (misplaced
})
somewhere) and a typo in the same tests (projects.createActive(project.id)
instead ofprojects.setActive(project.id)
.)See #1839 for the major bug that appeared the last time I tried to upgrade the NextJS apps to
mobx-react
v6. I haven't been able to reproduce it on this branch, testing locally with a production build and PH-TESS.Package:
app-content-pages
app-project
lib-classifier
Review Checklist
General
Components
Apps
yarn panic && yarn bootstrap
ordocker-compose up --build
and app works as expected?Publishing
Post-merging