Skip to content

@tus/s3-store: delete incomplete parts when removing uploads - #897

Merged
Murderlon merged 1 commit into
tus:mainfrom
ferhatelmas:s3-part-orphan
Oct 23, 2026
Merged

Murderlon merged 1 commit into
tus:mainfrom
ferhatelmas:s3-part-orphan

Conversation

@ferhatelmas

@ferhatelmas ferhatelmas commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Devin Review

Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
@ferhatelmas
ferhatelmas deployed to external-testing October 23, 2026 08:44 — with GitHub Actions Active
@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d0932e9

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

This PR includes changesets to release 1 package
Name Type
@tus/s3-store 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 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

Bucket: this.bucket,
Delete: {
Objects: [{Key: id}, {Key: this.infoKey(id)}],
Objects: [{Key: id}, {Key: this.infoKey(id)}, {Key: this.partKey(id, true)}],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Failed part deletion reports success

When S3 rejects only the .part deletion, remove still succeeds. deleteObjects reports per-object failures in Errors, leaving the part behind.

Learn more

S3 can return HTTP 200 from a multi-object delete even when it could not delete one requested key. Its response lists failed keys in Errors. The new .part deletion shares a request with the upload and info objects, but remove discards that response. A denied .part deletion therefore leaves the incomplete object behind after termination succeeds.

Example: A bucket policy permits deleting sample and sample.info but denies deleting sample.part. Terminating sample removes the first two objects and returns success, while sample.part remains.

Recommended fix: Inspect DeleteObjectsCommandOutput.Errors in remove and reject if any requested deletion failed; add a stubbed partial-success response to the termination tests.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@ferhatelmas ferhatelmas Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct but existing design, we are just doing best effort and still better than nothing for most cases

@Murderlon
Murderlon enabled auto-merge October 23, 2026 17:53
@Murderlon
Murderlon added this pull request to the merge queue Oct 23, 2026
Merged via the queue into tus:main with commit 6498076 Oct 23, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
external-testing — d0932e91 Deployed Oct 23, 2026 by ferhatelmas via Tests #108
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