Opened 8 years ago

Closed 3 years ago

#2019 closed task (fixed)

Investigate problems with error handling in the file upload

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.19
Component: web Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

See #2018 for more information.

Using AJAX for the file upload (see #2258 [7985]) might help to solve this problem. If the XMLHttpRequest.abort() works we could tell both the server side and the client side that we want to abort.

Change History (4)

comment:1 by Nicklas Nordborg, 3 years ago

Description: modified (diff)
Milestone: BASE Future ReleaseBASE 3.19

comment:2 by Nicklas Nordborg, 3 years ago

In 7986:

References #2019: Investigate problems with error handling in the file upload

The solution to the problems seems to be to tell both sides to abort the file transfer when either the user manually aborts the upload or when there is some other error on the server side.

The difficult part is when an error happens on the server side since the browser will then re-try the upload again without any interaction that we can detect. To fix this:

  1. The Upload class has been changed so that when an exception happens the exception is pushed to the ProgressReporter implementation and the upload thread is then put in a waiting state for up to 10 seconds.

  1. The file upload dialog that is checking the progress with ~1 seconds interval will get information about the error. The upload thread is released (ajax.jsp) and the upload request is aborted in the browser (upload.js).

Manually aborting is theoretically easier since we can do this in the browser and then also notify the server via an AJAX call. On the server side this also generates an exception, which is handled as any other exception and we rely on the progress updated to display an error message.

comment:3 by Nicklas Nordborg, 3 years ago

In 7991:

References #2019 and #2258.

Fixes issues with aborting and progress reporting when lots of already existing files are skipped. This means that there is no actual upload going on so we can simply abort from the client side.

comment:4 by Nicklas Nordborg, 3 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.