Repository navigation
DX-3200: clear error for browser upload outside a browser - #14
Merged
Merged
Conversation
ytkimirti
marked this pull request as ready for review
October 23, 2026 08:24
CahidArda
reviewed
Oct 23, 2026
Contributor
There was a problem hiding this comment.
Re-sending a cut-off end can delete an accepted upload (high).
routeCall now re-sends a call whose 2xx body was cut off (src/browser/task.ts:583-588). A 2xx for end means onUploadComplete has already returned, and end isn't idempotent on the server:
- Single PUT:
onUploadCompleteruns again. If it throws (for example a duplicate key),discard()deletes the object the first call accepted. - Multipart:
onUploadCompleteruns again, so the app gets a duplicate row.
Fix: don't re-send end after a 2xx; throw a "completed, response lost" error instead. Main's existing retries of end on 5xx and network errors have the same problem, so end should also be made idempotent on the server.
Release notes: upload() now throws synchronously outside a browser, and headers() throws now return 400 (other non-BlobErrors 500) instead of 503.
…en its body drops, 503 for a browser abort
ytkimirti
force-pushed
the
DX-3200-browser-env
branch
from
October 27, 2026 08:25
84e3883 to
fddc4e1
Compare
CahidArda
approved these changes
Oct 27, 2026
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.
upload()and the upload hooks now throwinvalid_input(400) namingBucket.putwhenXMLHttpRequestis missing, before any route call, instead of failing afterbeginas a 503request_failed.A
headers()throw or non-JSONinputis now a 400 and other bugs a 500 instead of 503; any 2xx forendcounts as accepted, so a cut-off or malformed answer is a 502 thatretry()and resume never re-send.Docs: upstash/docs#953