Skip to content

fix(s3): ListObjectsV2 must not surface delete markers as live objects (#316)#317

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/316-s3-delete-marker-list
Jun 5, 2026
Merged

fix(s3): ListObjectsV2 must not surface delete markers as live objects (#316)#317
scttfrdmn merged 1 commit into
mainfrom
fix/316-s3-delete-marker-list

Conversation

@scttfrdmn
Copy link
Copy Markdown
Owner

Summary

  • loadObjectEntry (used by ListObjectsV2 and ListObjects) did not filter entries where IsDeleteMarker is true
  • On versioning-enabled buckets, DeleteObjects inserts delete markers rather than removing the state key; without the filter, aws s3 ls showed objects that GetObject correctly returned 404 for
  • Added the same IsDeleteMarker guard that getObject already carries

Changes

  • emulator/s3_plugin.go: three-line fix in loadObjectEntry — return nil, nil when obj.IsDeleteMarker is true
  • emulator/s3_plugin_test.go: regression test TestS3_DeleteObjects_Versioned_HiddenFromList
  • CHANGELOG.md: move entry to [v0.68.1]

Test plan

  • go test ./emulator/ -run TestS3_DeleteObjects_Versioned_HiddenFromList — new regression test passes
  • go test ./emulator/ -run TestS3 — all existing S3 tests still pass
  • go test ./emulator/ -count=1 — full suite clean

Closes #316

ListObjectsV2 (and ListObjects) surfaced delete markers as live objects
on versioning-enabled buckets. DeleteObjects correctly inserted delete
markers but loadObjectEntry did not skip entries where IsDeleteMarker is
true, so aws s3 ls showed objects that GetObject correctly returned 404 for.

Adds the same IsDeleteMarker guard that getObject already carries, and a
regression test (TestS3_DeleteObjects_Versioned_HiddenFromList) that
verifies ListObjectsV2 returns zero objects after a multi-delete on a
versioned bucket.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn scttfrdmn merged commit 35bd649 into main Jun 5, 2026
10 checks passed
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.

S3 DeleteObjects (multi-delete) reports success but does not remove objects

1 participant