Merged
Conversation
uncompletedFileCategories
UniquePanda
added a commit
that referenced
this pull request
Mar 12, 2026
bb90da9 to
4e05207
Compare
Floriszenz
approved these changes
Mar 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Immediately after releasing version 5.0.0 we noticed that cancelling uploads was broken.
This is due to race conditions between the previous way of cancelling uploads and the new concept of upload tasks. Previously the code only iterated over all files and aborted them without "notifying" any other code parts about the cancellation. This means any upload task simply picked up the next chunk when its current one was aborted and the upload continued as before.
Now, a boolean is set that will be checked before an upload task picks up a new chunk. In case this bool is true, no new chunk will be uploaded. Additionally, only the files that were currently being uploaded by any upload task are aborted, because we know that no other file is currently uploading.
This also fixes a problem that existed prior to version 5: With many files, it was not really possible to cancel the upload, because the browser would hang, asking the user multiple times if they want to wait or leave the side (because the iteration over all files and chunks took so long). Now this operation should be pretty much instant.
Only one caveat: I kept the iteration over all chunks of a file that is being aborted. So for really really big files it will probably still take some time, but I think it's still better than before, certainly not worse.
I kept that in because the code when aborting a file upload is doing some additional stuff and I wanted to have this fix asap, so I only touched the code in
resumable.ts.Note:
The readme always said that the list of files is emptied when the upload is cancelled. This was not the case before. The files weren't removed from the list, but all of their chunks were removed. I fixed this.
Technically that's a breaking change, although the behavior was broken before. So we should release this fix as version 6.0.0. 😄