Patch Changes
-
#2371
536d94a- FixcancelUploadleaving parallel chunks uploading.file.xhronly holds the request that started last, so cancelling a chunked upload running withparallelChunkUploadsaborted that one request and left every other in-flight chunk streaming to the server — burning the user's bandwidth and writing orphaned chunks for a file the UI already showed as canceled.Every chunk keeps its own request, so
cancelUploadnow aborts all of the ones still running. Uploads that are not chunked are unaffected. -
#2372
a1a67df- Fixemitskipping a listener when another one removes itself.emitwalked the live callback array, so a listener that calledofffor itself — the usual shape of a one-shot listener, and of teardown code — spliced the array out from under the loop and the listener registered right after it never ran.emitnow iterates over a snapshot.One consequence worth knowing about: a listener registered from inside another listener no longer runs during that same
emit, it runs from the next one. That is what Node'sEventEmitterdoes, and it is the only way to keep the removal case correct. -
#2370
0e3625d- Fix the thumbnail queue deadlocking when a file cannot be read.createThumbnailonly listened forFileReader'sloadevent. A file that had been moved, locked by another process, or was otherwise unreadable since it was dropped fireserrorinstead, so the callback was never invoked and_processThumbnailQueuekept its lock forever: no file added afterwards got a thumbnail, and withresizeWidth/resizeHeightor atransformFilethat usescreateThumbnail, the upload never started either.The read error now reaches the callback the same way an undecodable image already did, so the file gets
dictThumbnailErrorand the queue moves on.DropzoneThumbnailCallbacksays what it has always done, too: its first argument isstring | Event, the error event standing in for the data URL when no thumbnail could be produced. That also fixesdisplayExistingFile, which used to emit that event as a thumbnail when the image URL failed to load, leaving the preview withimg.srcset to"[object Event]".