[pull] main from enyo:main - #12
Merged
Merged
Conversation
`cancelUpload` aborted `file.xhr`, which only ever holds the request that started last. With `parallelChunkUploads` the other chunks kept streaming to the server for a file the UI already showed as canceled, and if the last chunk had finished, `file.xhr` pointed at a completed request and the abort did nothing at all. Each chunk already carries its own `xhr`, so walk `file.upload.chunks` and abort the ones still uploading. Non-chunked uploads keep aborting `file.xhr` as before. Fixes #2366 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`emit` iterated `this._callbacks[event]` directly, so a listener that removed itself with `off` -- how a one-shot listener is usually written, and what teardown code does -- spliced the array while the loop was walking it. Everything after the removed entry shifted down past the loop's index, and the next listener was silently skipped. Iterate over a copy instead, the way EventEmitter does. This also means a listener registered from inside another listener first runs on the next emit rather than the current one. Fixes #2367 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`createThumbnail` only handled `FileReader`'s `load` event. A file that had been moved, locked by another process, or was otherwise unreadable since it was dropped fires `error` instead, so the callback was never invoked and `_processThumbnailQueue` kept `_processingThumbnail` set forever. No file added afterwards ever got a thumbnail, and where `transformFile` goes through `createThumbnail` -- which it does as soon as `resizeWidth` or `resizeHeight` is set -- the upload never started either. Hand the error event to the callback, which is what the `img.onerror` path in `createThumbnailFromUrl` already did, so the file is reported with `dictThumbnailError` and the queue carries on. `DropzoneThumbnailCallback` now declares that: `string | Event` rather than `string`, which is what both failure paths have always passed. The two casts that hid it are gone, and with the real signature in place the compiler found `displayExistingFile` emitting the error event as a thumbnail, so a preview whose image URL failed to load ended up with `img.src` set to "[object Event]". Fixes #2365 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Release the thumbnail queue when a file cannot be read
Abort every in-flight chunk when a chunked upload is canceled
Snapshot the listeners emit() walks
Version packages
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )