flowjs / flow.js

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.
Other
2.96k stars 346 forks source link

chunk.abort() to set FlowFile status to "pending" instead of "uploading" #349

Closed drzraf closed 2 years ago

drzraf commented 2 years ago

One way abort() can be called on a chunk is by a failure detected by the doneHandler() In that case, the chunk's status() would still be uploading what does not keep a retry from happening because it'd skip the uploadNextChunk() codepath.

But there is another case which is calling File.pause() where a call to resume() is expected to go through uploadNextChunk() which does check chunk's status() is pending. It's also semantically more adequate and that what this PR fixes.

This is a requirement for #348 which go deeper into testing pause/resume behaviors.

AidasK commented 2 years ago

Looks fine. I would approve this but can't, since I can't find "Approve" button. Please merge it :)

drzraf commented 2 years ago

Looks fine. I would approve this but can't, since I can't find "Approve" button.

Why so ?