Skip to content

Restore #6314 : @uppy/tus: don't abort errored request#6365

Open
qxprakash wants to merge 3 commits into
transloadit:mainfrom
qxprakash:restore/pr-6314
Open

Restore #6314 : @uppy/tus: don't abort errored request#6365
qxprakash wants to merge 3 commits into
transloadit:mainfrom
qxprakash:restore/pr-6314

Conversation

@qxprakash

Copy link
Copy Markdown
Collaborator

restore #6314 to d30c93d

  • merged main to it
  • resolved confilicts
  • squashed all commits into a single commit and sign it ( I had to do this as signing the past unsigned commits was difficult it was messing up the history everytime I tried )

@qxprakash qxprakash self-assigned this Jun 25, 2026
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4c30023

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@qxprakash

Copy link
Copy Markdown
Collaborator Author

this is the 3rd try :/ , hope it'll be fine this time.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 onError cleanup path so the XMLHttpRequest response remains intact.
  • Capture tus-js-client’s originalResponse and forward it as the optional third upload-error argument.
  • Add a jsdom + browser-build Vitest setup and a regression test using nock to 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.

@qxprakash qxprakash requested a review from mifi June 25, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants