Repository navigation
feat(tus): return version id on completion - #1506
Conversation
There was a problem hiding this comment.
LGTM — straightforward addition that mirrors the existing Supabase-Object-Id header pattern. Reviewed: the new Supabase-Object-Version-Id header is added to CORS exposed headers, set in onUploadFinish from resourceId.version, and set in onUploadHead only when the object is visible (same RLS-hiding branch as Supabase-Object-Id). Confirmed UploadId.version is always a non-empty string (constructor throws otherwise), so no undefined-header risk. Unit and integration tests were updated symmetrically for both the present and hidden/missing cases, plus a new round-trip download-by-versionId assertion.
Extended reasoning...
Four-file diff adding a response header (Supabase-Object-Version-Id) alongside an existing one, touching only the TUS HTTP route layer (index.ts CORS config, lifecycle.ts onUploadFinish/onUploadHead) plus matching test updates in lifecycle.test.ts and tus.test.ts. No new security-sensitive surface: it reuses the exact same RLS-visibility gate already in place for Supabase-Object-Id, and the version value comes from UploadId, which guarantees a non-empty string. The change is small, mechanical, and symmetric with the prior PR's pattern, with test coverage for both the positive and hidden/missing cases, so a human need not review it.
Coverage Report for CI Build 38590650765Coverage increased (+0.009%) to 85.384%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
04b8bea to
11a09da
Compare
Signed-off-by: Ferhat Elmas <[email protected]>
11a09da to
39b4954
Compare
What kind of change does this PR introduce?
feat
What is the current behavior?
Object id is added in #1500 but it's less useful without version id.
What is the new behavior?
Add version id similarly.
Additional context
Related to #1500
https://www.rfc-editor.org/rfc/rfc6648.html#section-3