Repository navigation
fix(storage): harden resumable upload failure, cancel and record handling - #1985
Merged
spydon merged 1 commit intoOct 19, 2026
Merged
Conversation
spydon
deleted the
lukasklingsbo/sdk-2276-resumable-upload-review-fixes
branch
October 19, 2026 14:12
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.
Follow-up to #1984 (SDK-2276) with fixes from a review of the resumable upload code. #1984 was merged before these commits were pushed.
Fixes
resumeUpload(id, file)now returns that sameResumableUploadand resumes it, as documented. Before, it built a second handle, and the two could sendPATCHrequests to one upload URL at the same time._runthrew:donenever completed, the status stayeduploading, and every laterresume()was silently skipped.cancel()now waits for the in-flight request before deciding. If the response that completes the upload is already in, the upload completes,donereturns the stored object, and noDELETEis sent. Before,donefailed withResumableUploadCancelledExceptionfor an object that was already stored. While a cancel is pending,pause()andresume()do nothing, and callingcancel()again returns the same future.resumeUpload,resumeUploadBinaryanddiscardResumableUploadno longer send the client's headers for a record that holds a signed upload token, which matches how the upload was started.projectRefhelper insupabase_common.fileOptions.headersare sent with every request of the upload but are not recorded, so an upload continued after a restart goes without them.Not changed
When the
HEADafter a lost final response reports every byte received, but carries noSupabase-Object-Id, the upload still fails, as the spec requires. Current storage servers set that header on such aHEAD(onUploadHeadinsrc/http/routes/tus/lifecycle.ts).Tests
New unit tests:
All suites pass: storage (390, 15 skipped by an existing lifecycle condition), supabase_common, supabase and supabase_flutter.