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
Rejected promises are uncaught and don't trigger on('error') #3958
Comments
Hi, I think this has been brought up and fixed in #3950. From the PR:
|
👍 I'll close and revisit once it's out in production. Question - Should promise rejections be getting caught by the on('error') function (regardless of whether it is caused by a cancellation or something else) or is there another way to ensure promise rejections are caught? |
Currently the error is ignored: uppy/packages/@uppy/aws-s3-multipart/src/MultipartUploader.js Lines 425 to 434 in a5c73c3
We could uppy/packages/@uppy/core/src/Uppy.js Lines 944 to 960 in a5c73c3
|
There is not enough information to help. Can you create a new issue with a reproducible example on CodeSandbox/StackBlitz? |
Just realised the loss of recovery state isn't related to the uncaught error but is caused by the AbortController, I think, it deletes the local storage state on page reload - the error only is present on Firefox. or Test case: This doesn't happen in chrome or safari! |
Thanks, but your codesandbox is not publicly available. Can you open a new issue so we can track it? This is closed and unrelated. |
Initial checklist
Link to runnable example
No response
Steps to reproduce
unhandled promise rejection
.In my case in production, the scenario that triggered this was when writing an integration test on Cypress, when the test tried to delete a file. The delete button being ‘pressed’ before any part of the file had been uploaded led to an unhandled promise rejection (and failed the test).
When testing manually, everything works fine. After some debugging, I realise the integration test is failing because the ‘delete’ button is pressed before any part of the file has been uploaded, which leads to the abortMultipartUpload function being called without an uploadId (null).
This in turn is leading to an error: Uncaught (in promise) ClientError: Upload ID is required
Issues I am having:
Thanks in advance and thanks for a great library!
Note -Boilerplate Codesandbox link shows me a
ModuleNotFoundError
. I'll see if I can get one up to illustrate this.Expected behavior
Promise rejections should not be uncaught.
I may be doing something wrong in my code? If so, please let me know and I can fix it as well as contribute to the docs as to how promise rejections should be dealt with.
Actual behavior
An unhandled promise rejection is thrown on the client and the on('error') does not fire.
The text was updated successfully, but these errors were encountered: