Open drazenp opened 7 years ago
Thank you for a great write-up of the issue. Am curious to hear though about the specific negative consequences of multiple complete triggers?
I'm relying on the complete
event to show which files are uploaded. I cannot rely on fileSuccess
since the uploading process can be canceled anytime. So I have to track successfully uploaded files and on the complete
event show them.
This is not really stopper since with a flag it can be easily forced to work, but I guess upload should be completed only once :)
Is there a reason to call $.resumableObj.uploadNextChunk();
for each chunk while canceling upload?
I am also seeing this issue. In my setup I eventually pass my chunks to AWS' multipart upload API. When the complete
event is fired I send a request to my server to send a request to AWS to stitch the chunks together. A premature/unexpected firing of the complete
event causes AWS to stitch all the current chunks together for an existing upload. But since the request was premature not all the chunks are there meaning an incomplete file gets saved to S3. I can get around this by checking the progress of the file.
I agree with @drazenp and was wondering what the status on this was. Thanks!
Same.
While uploading multiple files (e.g. 5MB and 100MB files) and canceling the upload of the second file the
complete
event is called multiple times. The number ofcomplete
triggers is equal to the parametersimultaneousUploads
. Scenario:simultaneousUploads' is 3, and
chunkSize` is 1 MB.resumable.cancel()
).complete
will be triggered 3 times.The issue happens due to call of the method
uploadNextChunk
for each chunk with status 'uploading'.If first file require only one chunk (size around 1MB) then 'complete' will be called only once. This could be another issue because it could happen that in this case the upload doesn't go in parallel.
The issue is reproducible with Node.js sample.