@uppy/companion: send tus response body on upload success - #6492
Open
hakubo wants to merge 2 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 0798180 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
hakubo
force-pushed
the
companion-tus-success-response
branch
from
August 26, 2026 15:57
238d541 to
0798180
Compare
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 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.
What
When Companion uploads to a tus destination, it now forwards the destination's final response through the websocket
successpayload, asextraData.response— the same field the multipart and xhr paths already fill viagetRespObj.Why
A tus destination can answer the upload's final request with a body a client needs — in our case, the upload service responds to the last
PATCHwith a JSON record of the finished upload (id, storage location, thumbnail, media details), so the browser can attach the media without a follow-up call. Files uploaded directly with@uppy/tuscan read that response, but files routed through Companion could not:#uploadTus'sonSuccessresolved only the upload URL, and the record was dropped inside Companion.The asymmetry is already documented in the codebase.
@uppy/companion-clientsays it inRequestClient:and #4922 fixed the client half of this —
upload-successexposespayload.response.responseTextas a parsedbodywhenever Companion sends it. This PR fills in the server half for tus.How
tus-js-client's
onSuccessreceives{ lastResponse }since v4; the handler readsgetBody()andgetStatus()from it into the existingUploadExtraDataResponseshape. No new options, no protocol change — clients that ignoreextraData.responsesee the same payload as before, plus one field.Testing
Verified end to end against a tus server that answers the final
PATCHwith a JSON body: the websocketsuccessevent now carriesresponse: { responseText, status }, and@uppy/companion-clientsurfaces it asbodyonupload-successwithout changes.