Repository navigation
@tus/s3-store: delete incomplete parts when removing uploads - #897
Conversation
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
🦋 Changeset detectedLatest commit: d0932e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
| Bucket: this.bucket, | ||
| Delete: { | ||
| Objects: [{Key: id}, {Key: this.infoKey(id)}], | ||
| Objects: [{Key: id}, {Key: this.infoKey(id)}, {Key: this.partKey(id, true)}], |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
correct but existing design, we are just doing best effort and still better than nothing for most cases
Uh oh!
There was an error while loading. Please reload this page.