Open hiromi2424 opened 3 months ago
Here is (excerpted part of) my userland implementation to resolve issues of "2." and "3." in actual behavior section above.
https://gist.github.com/hiromi2424/e2b7c5baf4f6e8e5a1c71445a296d6bb
I had to create new endpoint to return actual recent upload statuses. This seems so hacky but works great to me.
It will be great if uppy library can focus this and internally implement or fix like this.
Initial checklist
Link to runnable example
No response
Steps to reproduce
Note: Some or all issues may be reproduced without setting shouldUseMultiPart always be true
Also: Setup companion server.
or
Press resume button of dashboard(I don't use but it is perhaps same behavior)
Expected behavior
Completed upload files may not be affected
Actual behavior
This is because aws-s3-multipart does not consider the completion flag.
Very fast solution is with patching file:
@uppy+aws-s3-multipart+3.11.1.patch
There is case that uploading to s3 have been finished(S3 complete endpoint was called) but flag of uploaded was not updated as true.
This case is caused by (maybe)two reason:
2-1. Golden retriever does not save last metadata before crash. Golden retriever have to save metadata when file state was changed. But with looking up the code:
node_modules/@uppy/golden-retriever/src/index.ts:86-90
It saves metadata with throttle. Crash causes
throttle
not to flush last invocation.Hint: Perhaps
uppy.getPlugin('GoldenRetriever').saveFilesStateToLocalStorage.flush()
call onbeforeunload
event or so will save last state when browser was reloaded. But "real browser crash" does not send event anyway.2-2. S3 complete endpoint was called but browser does not receive response
This makes completion of s3 multipart was done but metadata will not updated as finished upload.
I found a few case that reloading browser aborts upload. It will call
DELETE /s3/multipart/:upload_id
and upload ID of this will not be available anymore. But metadata continues to have such upload id and S3 key. This cause resuming upload will fail with invalid upload id.