Skip to content

feat(tus): return version id on completion - #1506

Merged
ferhatelmas merged 1 commit into
masterfrom
ferhat/tus-version
Oct 14, 2026
Merged

ferhatelmas merged 1 commit into
masterfrom
ferhat/tus-version

Conversation

@ferhatelmas

@ferhatelmas ferhatelmas commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

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

@ferhatelmas
ferhatelmas requested a review from a team as a code owner October 14, 2026 09:55
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coveralls

coveralls commented Oct 14, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 38590650765

Coverage increased (+0.009%) to 85.384%

Details

  • Coverage increased (+0.009%) from the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15077
Covered Lines: 13323
Line Coverage: 88.37%
Relevant Branches: 9478
Covered Branches: 7643
Branch Coverage: 80.64%
Branches in Coverage %: Yes
Coverage Strength: 857.02 hits per line

💛 - Coveralls

@ferhatelmas
ferhatelmas enabled auto-merge (squash) October 14, 2026 15:35
@ferhatelmas
ferhatelmas merged commit d05b376 into master Oct 14, 2026
33 checks passed
@ferhatelmas
ferhatelmas deleted the ferhat/tus-version branch October 14, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants