CtrlK
BlogDocsLog inGet started
Tessl Logo

g14wxz/storage-resumable-upload

Implements TUS resumable upload protocol for files >6MB with advisory lock conflict handling.

100

Quality

100%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Risky

Do not use without reviewing

Overview
Quality
Evals
Security
Files

Storage Resumable Upload

Implements the TUS resumable upload protocol for files exceeding 6MB with Postgres Advisory Lock conflict handling and tenant-scoped paths.

Overview

This tile configures the TUS 1.0.0 resumable upload flow against the Supabase Storage API. Files over 6MB MUST use this protocol instead of the standard single-request upload. Uploads are chunked at 6MB boundaries, and each chunk is acknowledged by the server with an updated offset. On network interruption, the client resumes from the last confirmed offset. Concurrent uploads to the same path trigger a Postgres Advisory Lock, returning a 409 Conflict that MUST be handled with exponential backoff.

Reference

TUS Endpoint

POST ${SUPABASE_URL}/storage/v1/upload/resumable
PATCH <upload-url-from-location-header>
HEAD  <upload-url-from-location-header>

Required Headers (POST -- Create)

HeaderValue
AuthorizationBearer <access_token>
Tus-Resumable1.0.0
Upload-LengthFile size in bytes
Upload-Metadatabase64-encoded bucket, object, contentType
x-upsertfalse (default)

Required Headers (PATCH -- Upload Chunk)

HeaderValue
Content-Typeapplication/offset+octet-stream
Upload-OffsetCurrent byte offset
Tus-Resumable1.0.0

Conflict Handling

StatusCauseAction
409Advisory Lock collisionRetry with backoff: 1s, 2s, 4s

Path Format

<tenant_id>/<resource_type>/<filename>

Dependencies

  • supabase-mcp-verification -- validates upload results and object state.
  • storage-path-validation -- sanitizes and validates all upload paths before requests are sent.

Composition Position

  • MUST execute after bucket creation and storage policies are in place.
  • MUST execute after storage-path-validation is deployed.
  • Path structure enforces tenant isolation at the storage layer, complementing RLS at the database layer.
Workspace
g14wxz
Visibility
Public
Created
Last updated
Publish Source
CLI
Badge
g14wxz/storage-resumable-upload badge