-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: OPTIC-1794: Improve handling of missing tasks and projects when fetching data within DataManager #7210
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
Merged
Conversation
This file contains hidden or 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
…ast messages in favour of modals and increased Sentry reporting
…r of the hook to mock it in order to stop it from causing errors even if unused
…mpty result error key
…fetching data within DataManager
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
nick-skriabin
approved these changes
Mar 12, 2025
hlomzik
reviewed
Mar 12, 2025
hlomzik
reviewed
Mar 12, 2025
hlomzik
reviewed
Mar 12, 2025
hlomzik
approved these changes
Mar 12, 2025
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.
Some non-critical observations but would be really great to fix them, they are simple and precise.
Co-authored-by: Andrew <[email protected]>
bmartel
commented
Mar 12, 2025
bmartel
commented
Mar 12, 2025
/fm sync |
/fm sync |
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.
This pull request includes a couple updates to error handling within the
DataManager
component. We are introducing more graceful ways of handling missing tasks and project data, siding with redirects and more subtle toast messages instead of crashing the page and leaving the user in an unusable state of the application. We are now no longer going to treat polling data the same as normal data requests, as one is non critical and nice to have, the other must exist for the application to work. In the case of pollinginteraction="timer"
data we will ignore these errors completely and allow it to retry. The non polling data fetching the main project or task will be handled with a redirect back to the page previous, DataManager of the project (missing task), or the projects list itself (missing project) in that order based on what the missing data type is.Kapture.2025-03-11.at.20.40.27.webm
Error Handling and Redirection Improvements:
web/apps/labelstudio/src/pages/DataManager/DataManager.jsx
: Enhanced the crash event handling to redirect users based on the error details, either to the home page or the projects page.web/libs/datamanager/src/stores/AppStore.js
: Updated thecrash
method to accept an options parameter, allowing conditional redirection based on the error context.web/libs/datamanager/src/stores/AppStore.js
: Modified the project fetching logic to handle cases where the project does not exist, triggering a crash with redirection.Project and Task Data Handling:
web/libs/datamanager/src/stores/AppStore.js
: Added a check for the length of the new project data to ensure valid comparison and updating of the project state.web/libs/datamanager/src/stores/DataStores/tasks.js
: Enhanced the task data retrieval process to handle task cancellations and non-existent tasks, invoking a crash with redirection if necessary.