Skip to content

@tus/s3-store: keep cached metadata in sync on length declaration and cleanup - #910

Merged
Murderlon merged 5 commits into
mainfrom
devin/1793622502-s3-metadata-sync
Nov 2, 2026
Merged

Murderlon merged 5 commits into
mainfrom
devin/1793622502-s3-metadata-sync

Conversation

@Murderlon

@Murderlon Murderlon commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #901, retaining @ferhatelmas’s commit and resolving the test conflict with current main. Updating the contributor branch was denied (HTTP 403).

  • Update cached metadata after deferred-length declaration and await eviction in remove().
  • Evict metadata in deleteExpired(), which bypasses remove(), so subsequent lookups do not use stale cached upload information after server cleanup.
  • Define missing-key deletion as successful at the KvStore boundary. FileKvStore.delete() uses fs.rm(..., {force: true}), preserving genuine failures without filesystem-specific handling in S3.
  • Cover deferred-length uploads with FileKvStore, expiration cache eviction, absent cache entries, and eviction failures. Preserve existing empty-upload regressions and assert that missing multipart-upload lookups make no extra HEAD request.

Final-object HEAD verification is deliberately excluded to avoid adding a sequential S3 request to every completed-upload lookup. The existing limitation remains: externally aborted uploads with surviving metadata can be reported as completed; #900 would also exempt these from expiration. This trade-off was accepted for short resume windows relative to multi-day lifecycle cleanup. Server HEAD/PATCH behavior and cleanup locking are unchanged here.

Includes patch changesets for @tus/s3-store and @tus/utils. Existing Changesets updateInternalDependencies: patch configuration updates dependency ranges during the release version step.

Verified locally: npm run build, npm run format:check, and npm run lint. Tests run in CI per repository instructions.

Link to Devin session: https://app.devin.ai/sessions/13d351b16409431d8791d4164d8692e5
Open in Devin Desktop: https://app.devin.ai/desktop/session/13d351b16409431d8791d4164d8692e5?variant=devin
Requested by: @Murderlon


Devin Review

@changeset-bot

changeset-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: da8a8f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tus/s3-store Patch
@tus/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/s3-store/src/index.ts Resolved
@devin-ai-integration devin-ai-integration Bot changed the title @tus/s3-store: keep metadata in sync and verify upload completion @tus/s3-store: keep cached metadata in sync on length declaration and cleanup Nov 2, 2026
@Murderlon
Murderlon added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 15e647e Nov 2, 2026
4 checks passed
@Murderlon
Murderlon deleted the devin/1793622502-s3-metadata-sync branch November 2, 2026 13:56
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.

2 participants