-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: FIT-1297: Guard async operations against destroyed store #9263
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
base: develop
Are you sure you want to change the base?
Conversation
The selectHistory function uses setTimeout to update classifications after render. If the store is destroyed before the timeout fires (e.g., during navigation), it could access dead nodes. Added isAlive(self) check at the start of the setTimeout callback to prevent accessing destroyed store state.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9263 +/- ##
===========================================
- Coverage 66.82% 57.66% -9.16%
===========================================
Files 830 561 -269
Lines 64879 40549 -24330
Branches 10971 11010 +39
===========================================
- Hits 43355 23383 -19972
+ Misses 21520 17162 -4358
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
Problem
setTimeoutinselectHistory()can fire after the store is destroyed (e.g., during navigation), causing it to access dead MST nodes and throw warnings.Solution
Add
isAlive(self)guard at the start of the setTimeout callback to prevent accessing destroyed store state.Files Changed
web/libs/editor/src/stores/Annotation/store.js