-
Notifications
You must be signed in to change notification settings - Fork 2.1k
@uppy/core: fix undefined reference when cancelling an upload #5730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Diff output filesdiff --git a/packages/@uppy/core/lib/Uppy.js b/packages/@uppy/core/lib/Uppy.js
index e4bf6e8..614cd33 100644
--- a/packages/@uppy/core/lib/Uppy.js
+++ b/packages/@uppy/core/lib/Uppy.js
@@ -1598,6 +1598,11 @@ async function _runUpload2(uploadID) {
}
if (result == null) {
this.log(`Not setting result for an upload that has been removed: ${uploadID}`);
+ result = {
+ successful: [],
+ failed: [],
+ uploadID,
+ };
}
return result;
} |
IMO this fixes another bug , when we cancelled upload , it should not be considered as failed one but the Status bar UI showed it as failed with retry button. |
Murderlon
approved these changes
Apr 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks for the fix!
Merged
github-actions bot
added a commit
that referenced
this pull request
May 18, 2025
| Package | Version | Package | Version | | -------------------------- | ------- | -------------------------- | ------- | | @uppy/audio | 2.1.3 | @uppy/image-editor | 3.3.3 | | @uppy/box | 3.2.3 | @uppy/instagram | 4.2.3 | | @uppy/companion | 5.7.0 | @uppy/onedrive | 4.2.4 | | @uppy/companion-client | 4.4.2 | @uppy/remote-sources | 2.3.3 | | @uppy/core | 4.4.5 | @uppy/screen-capture | 4.2.3 | | @uppy/dashboard | 4.3.4 | @uppy/unsplash | 4.3.4 | | @uppy/drag-drop | 4.1.3 | @uppy/url | 4.2.4 | | @uppy/dropbox | 4.2.3 | @uppy/utils | 6.1.4 | | @uppy/facebook | 4.2.3 | @uppy/webcam | 4.1.3 | | @uppy/file-input | 4.1.3 | @uppy/webdav | 0.3.3 | | @uppy/google-drive | 4.3.3 | @uppy/zoom | 3.2.3 | | @uppy/google-drive-picker | 0.3.5 | uppy | 4.16.0 | | @uppy/google-photos-picker | 0.3.5 | | | - @uppy/companion-client: don't reject on incorrect origin (Mikael Finstad / #5736) - @uppy/companion: implement credentials param `transloadit_gateway` (Mikael Finstad / #5725) - @uppy/companion: Fix AES key wear-out (Florian Maury / #5724) - @uppy/core: fix undefined reference when cancelling an upload (Prakash / #5730) - @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728)
Merged
github-actions bot
added a commit
that referenced
this pull request
May 18, 2025
| Package | Version | Package | Version | | -------------------------- | ------- | -------------------------- | ------- | | @uppy/audio | 2.1.3 | @uppy/image-editor | 3.3.3 | | @uppy/box | 3.2.3 | @uppy/instagram | 4.2.3 | | @uppy/companion | 5.7.0 | @uppy/onedrive | 4.2.4 | | @uppy/companion-client | 4.4.2 | @uppy/remote-sources | 2.3.3 | | @uppy/core | 4.4.5 | @uppy/screen-capture | 4.2.3 | | @uppy/dashboard | 4.3.4 | @uppy/unsplash | 4.3.4 | | @uppy/drag-drop | 4.1.3 | @uppy/url | 4.2.4 | | @uppy/dropbox | 4.2.3 | @uppy/utils | 6.1.4 | | @uppy/facebook | 4.2.3 | @uppy/webcam | 4.1.3 | | @uppy/file-input | 4.1.3 | @uppy/webdav | 0.3.3 | | @uppy/google-drive | 4.3.3 | @uppy/zoom | 3.2.3 | | @uppy/google-drive-picker | 0.3.5 | uppy | 4.16.0 | | @uppy/google-photos-picker | 0.3.5 | | | - meta: Revert "Release: uppy@4.16.0 (#5750)" (Mikael Finstad) - meta: force cdn upload (Mikael Finstad) - meta: fix invalid brach option (now ref) (Mikael Finstad) - meta: improve release script output (Mikael Finstad) - meta: fix error (Mikael Finstad) - meta: Release: uppy@4.16.0 (github-actions[bot] / #5750) - meta: Fix node versions (Mikael Finstad / #5740) - @uppy/companion-client: don't reject on incorrect origin (Mikael Finstad / #5736) - @uppy/companion: implement credentials param `transloadit_gateway` (Mikael Finstad / #5725) - @uppy/companion: Fix AES key wear-out (Florian Maury / #5724) - @uppy/core: fix undefined reference when cancelling an upload (Prakash / #5730) - @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728)
Merged
github-actions bot
added a commit
that referenced
this pull request
May 18, 2025
| Package | Version | Package | Version | | -------------------------- | ------- | -------------------------- | ------- | | @uppy/audio | 2.1.3 | @uppy/image-editor | 3.3.3 | | @uppy/box | 3.2.3 | @uppy/instagram | 4.2.3 | | @uppy/companion | 5.7.0 | @uppy/onedrive | 4.2.4 | | @uppy/companion-client | 4.4.2 | @uppy/remote-sources | 2.3.3 | | @uppy/core | 4.4.5 | @uppy/screen-capture | 4.2.3 | | @uppy/dashboard | 4.3.4 | @uppy/unsplash | 4.3.4 | | @uppy/drag-drop | 4.1.3 | @uppy/url | 4.2.4 | | @uppy/dropbox 8000 | 4.2.3 | @uppy/utils | 6.1.4 | | @uppy/facebook | 4.2.3 | @uppy/webcam | 4.1.3 | | @uppy/file-input | 4.1.3 | @uppy/webdav | 0.3.3 | | @uppy/google-drive | 4.3.3 | @uppy/zoom | 3.2.3 | | @uppy/google-drive-picker | 0.3.5 | uppy | 4.16.0 | | @uppy/google-photos-picker | 0.3.5 | | | - meta: Revert "Release: uppy@4.16.0 (#5750)" (Mikael Finstad) - meta: force cdn upload (Mikael Finstad) - meta: fix invalid brach option (now ref) (Mikael Finstad) - meta: improve release script output (Mikael Finstad) - meta: fix error (Mikael Finstad) - meta: Release: uppy@4.16.0 (github-actions[bot] / #5750) - meta: Fix node versions (Mikael Finstad / #5740) - @uppy/companion-client: don't reject on incorrect origin (Mikael Finstad / #5736) - @uppy/companion: implement credentials param `transloadit_gateway` (Mikael Finstad / #5725) - @uppy/companion: Fix AES key wear-out (Florian Maury / #5724) - @uppy/core: fix undefined reference when cancelling an upload (Prakash / #5730) - @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728)
Merged
github-actions bot
added a commit
that referenced
this pull request
May 18, 2025
| Package | Version | Package | Version | | -------------------------- | ------- | -------------------------- | ------- | | @uppy/audio | 2.1.3 | @uppy/image-editor | 3.3.3 | | @uppy/box | 3.2.3 | @uppy/instagram | 4.2.3 | | @uppy/companion | 5.7.0 | @uppy/onedrive | 4.2.4 | | @uppy/companion-client | 4.4.2 | @uppy/remote-sources | 2.3.3 | | @uppy/core | 4.4.5 | @uppy/screen-capture | 4.2.3 | | @uppy/dashboard | 4.3.4 | @uppy/unsplash | 4.3.4 | | @uppy/drag-drop | 4.1.3 | @uppy/url | 4.2.4 | | @uppy/dropbox | 4.2.3 | @uppy/utils | 6.1.4 | | @uppy/facebook | 4.2.3 | @uppy/webcam | 4.1.3 | | @uppy/file-input | 4.1.3 | @uppy/webdav | 0.3.3 | | @uppy/google-drive | 4.3.3 | @uppy/zoom | 3.2.3 | | @uppy/google-drive-picker | 0.3.5 | uppy | 4.16.0 | | @uppy/google-photos-picker | 0.3.5 | | | - meta: Revert "Release: uppy@4.16.0 (#5750)" (Mikael Finstad) - meta: force cdn upload (Mikael Finstad) - meta: fix invalid brach option (now ref) (Mikael Finstad) - meta: improve release script output (Mikael Finstad) - meta: fix error (Mikael Finstad) - meta: Release: uppy@4.16.0 (github-actions[bot] / #5750) - meta: Fix node versions (Mikael Finstad / #5740) - @uppy/companion-client: don't reject on incorrect origin (Mikael Finstad / #5736) - @uppy/companion: implement credentials param `transloadit_gateway` (Mikael Finstad / #5725) - @uppy/companion: Fix AES key wear-out (Florian Maury / #5724) - @uppy/core: fix undefined reference when cancelling an upload (Prakash / #5730) - @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728)
Merged
github-actions bot
added a commit
that referenced
this pull request
May 18, 2025
| Package | Version | Package | Version | | -------------------------- | ------- | -------------------------- | ------- | | @uppy/audio | 2.1.3 | @uppy/image-editor | 3.3.3 | | @uppy/box | 3.2.3 | @uppy/instagram | 4.2.3 | | @uppy/companion | 5.7.0 | @uppy/onedrive | 4.2.4 | | @uppy/companion-client | 4.4.2 | @uppy/remote-sources | 2.3.3 | | @uppy/core | 4.4.5 | @uppy/screen-capture | 4.2.3 | | @uppy/dashboard | 4.3.4 | @uppy/unsplash | 4.3.4 | | @uppy/drag-drop | 4.1.3 | @uppy/url | 4.2.4 | | @uppy/dropbox | 4.2.3 | @uppy/utils | 6.1.4 | | @uppy/facebook | 4.2.3 | @uppy/webcam | 4.1.3 | | @uppy/file-input | 4.1.3 | @uppy/webdav | 0.3.3 | | @uppy/google-drive | 4.3.3 | @uppy/zoom | 3.2.3 | | @uppy/google-drive-picker | 0.3.5 | uppy | 4.16.0 | | @uppy/google-photos-picker | 0.3.5 | | | - meta: Revert "Release: uppy@4.16.0 (#5750)" (Mikael Finstad) - meta: force cdn upload (Mikael Finstad) - meta: fix invalid brach option (now ref) (Mikael Finstad) - meta: improve release script output (Mikael Finstad) - meta: fix error (Mikael Finstad) - meta: Release: uppy@4.16.0 (github-actions[bot] / #5750) - meta: Fix node versions (Mikael Finstad / #5740) - @uppy/companion-client: don't reject on incorrect origin (Mikael Finstad / #5736) - @uppy/companion: implement credentials param `transloadit_gateway` (Mikael Finstad / #5725) - @uppy/companion: Fix AES key wear-out (Florian Maury / #5724) - @uppy/core: fix undefined reference when cancelling an upload (Prakash / #5730) - @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728)
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.
This fixes #5729
Before :
when you upload a large file and cancel it midway
you would see this error , and in some cases as encountered by @LukasHirt , emits a complete event with undefined payload , both the issues are related , and infact same
complete event is emitted with an undefined result value , which errors out in handleComplete event
This is happening because upon clicking the cancel button uppy.cancelAll() removeFiles is called which resets the currentUploads
which leads to currentUpload being undefined and result returned from #runUpload as undefined
and that result is sent with non null assertion in the 'complete' event
uppy/packages/@uppy/core/src/Uppy.ts
Lines 2334 to 2338 in d58cc20
all leading to this error
After :
in case of result == null , we send a default result object with empty succesfull and failed , arrays