feat(storage): add StorageTransferTask, MultipartUploadEngine, and upload API#991
Open
grdsdev wants to merge 4 commits into
Open
feat(storage): add StorageTransferTask, MultipartUploadEngine, and upload API#991grdsdev wants to merge 4 commits into
grdsdev wants to merge 4 commits into
Conversation
…load API - Add StorageTransferTask<Success> with AsyncStream progress events and async value property - Add MultipartUploadEngine actor for standard multipart POST uploads - Add UploadSource type for abstracting Data vs file URL uploads - Update upload() and update() methods to return StorageUploadTask instead of Void - Remove old incompatible integration tests (replaced in later PR) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
update() was delegating to upload() with upsert: true, which sent a POST + x-upsert header. The correct behaviour (matching supabase-js) is a PUT request with no x-upsert header. TUS does not have an update concept, so the method: parameter is removed from both update overloads. - MultipartUploadEngine.makeTask now accepts httpMethod (default .post) - update(data:) and update(fileURL:) call multipart with httpMethod: .put - Tests updated: POST mocks → PUT mocks, upsert assertions removed, new assertion verifies PUT method and absence of x-upsert header
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.
Summary
StorageTransferTask<Success>— a unified handle withAsyncStream<TransferEvent<Success>>progress events and an asyncvaluepropertyMultipartUploadEngineactor for standard multipart POST uploads withURLSessionTaskDelegateprogress events and temp-file streaming for large filesFileUploadandUploadSourceinto a singleUploadSourcetypeupload()andupdate()to returnStorageUploadTaskinstead ofVoidAPI changes
Test plan
StorageTransferTaskTests— all passMultipartUploadEngineTests— all passStorageFileAPITests— all passUploadProgressTests— all pass🤖 Generated with Claude Code