Cannot read properties of null (reading 'annotations')
Actions before raising this issue
- [X] I searched the existing issues and did not find anything similar.
- [X] I read/searched the docs
Steps to Reproduce
- Open a job
- Upload annotations to the job
- Go to task page before upload is done
Expected Behavior
No response
Possible Solution
No response
Context
No response
Environment
v2.10.0
I'm interested in this issue and am ready to tackle it. Could you please assign it to me?
I was able to reproduce this bug.
Issue
When I navigate away from the page while uploading annotations the message "Cannot read properties of null (reading 'annotations')" along with "Annotations have been loaded to the task" are displayed to the user. This error occurs because the FETCH_ANNOTATIONS_FAILED action is triggered since annotations have to be loaded and fetched yet I navigated away from the page, even though the annotations loading process is still a success. This leads to unnecessary error message being displayed.
Root Cause
The root cause of the issue is that the FETCH_ANNOTATIONS_FAILED action is dispatched without considering the possibility of navigation interruption during the annotations fetching process.
Proposed Solution
To resolve this issue, I will implement a mechanism to detect navigation interruptions during the annotations fetching process. This involves modifying the fetchAnnotationsAsync function to handle navigation interruptions by checking if the interruption occurred before dispatching the FETCH_ANNOTATIONS_FAILED action. Additionally, I will update the error handling logic to consider navigation interruptions so that the warming isn't displayed if it was due to navigation interruptions.
@MKBenjie , please send us a PR which solves the issue. Could you please add a test as well?
Created the PR and added a test as well
@MKBenjie , could you please share a link on the PR? I cannot find it.
@nmanovic
https://github.com/opencv/cvat/pull/7704