cvat icon indicating copy to clipboard operation
cvat copied to clipboard

Cannot read properties of null (reading 'annotations')

Open bsekachev opened this issue 2 years ago • 6 comments

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

  1. Open a job
  2. Upload annotations to the job
  3. Go to task page before upload is done image

Expected Behavior

No response

Possible Solution

No response

Context

No response

Environment

v2.10.0

bsekachev avatar Jan 17 '24 08:01 bsekachev

I'm interested in this issue and am ready to tackle it. Could you please assign it to me?

MKBenjie avatar Mar 21 '24 14:03 MKBenjie

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 avatar Mar 23 '24 11:03 MKBenjie

@MKBenjie , please send us a PR which solves the issue. Could you please add a test as well?

nmanovic avatar Mar 25 '24 14:03 nmanovic

Created the PR and added a test as well

MKBenjie avatar Mar 30 '24 03:03 MKBenjie

@MKBenjie , could you please share a link on the PR? I cannot find it.

nmanovic avatar Apr 01 '24 14:04 nmanovic

@nmanovic

https://github.com/opencv/cvat/pull/7704

bsekachev avatar Apr 01 '24 15:04 bsekachev