Restore #6314 : @uppy/tus: don't abort errored request#6365
Conversation
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
this is the 3rd try :/ , hope it'll be fine this time. |
There was a problem hiding this comment.
Pull request overview
Restores and extends the fix from #6314 for @uppy/tus so that when an upload fails, the server response (HTTP status + body via XMLHttpRequest) is preserved and forwarded through the upload-error event (and persisted on file.response), instead of being wiped out by aborting the underlying request.
Changes:
- Avoid aborting the underlying tus request in the
onErrorcleanup path so theXMLHttpRequestresponse remains intact. - Capture
tus-js-client’soriginalResponseand forward it as the optional thirdupload-errorargument. - Add a jsdom + browser-build Vitest setup and a regression test using
nockto assert the error response is available.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds nock to the workspace lockfile for the new test dependency. |
| packages/@uppy/tus/vitest.config.ts | Ensures tests use the browser build of tus-js-client under jsdom and sets a same-origin jsdom URL so XHR status is observable. |
| packages/@uppy/tus/src/index.ts | Captures server error responses and skips aborting completed errored requests to preserve XHR status/body; forwards response via upload-error. |
| packages/@uppy/tus/src/index.test.ts | Adds regression coverage verifying upload-error receives the server response and that it’s persisted on the file. |
| packages/@uppy/tus/package.json | Adds nock dev dependency for the new test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
restore #6314 to d30c93d
mainto it