Skip to content

fix(s3): max-keys=0 returns empty non-truncated page#2003

Merged
vieiralucas merged 1 commit into
mainfrom
wt-s3-maxkeys
Jun 27, 2026
Merged

fix(s3): max-keys=0 returns empty non-truncated page#2003
vieiralucas merged 1 commit into
mainfrom
wt-s3-maxkeys

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 27, 2026

Copy link
Copy Markdown
Member

2026-06-27 bug-hunt Tier 1 finding 1.19 (S3).

ListObjectsV2/ListObjects with max-keys=0 hit count >= max_keys (0 >= 0) on the first object, setting IsTruncated=true and emitting a continuation token over an empty last_key (base64("") = ""), which the next request rejects with InvalidArgument. AWS returns KeyCount=0, IsTruncated=false, no token. Force is_truncated=false when max-keys=0 in both handlers.

Test: put 2 objects, list with max-keys=0 via V2 and V1 -> empty, not truncated, no token / NextMarker.


Summary by cubic

Fixes S3 ListObjects/ListObjectsV2 when max-keys=0 to return an empty, non-truncated page with no continuation token/NextMarker, matching AWS. Prevents InvalidArgument errors caused by an empty continuation token.

  • Bug Fixes
    • Force is_truncated=false when max_keys==0 in both list handlers.
    • Added e2e test covering V1 and V2: empty results, IsTruncated=false, no token/NextMarker.

Written for commit 1958688. Summary will update on new commits.

Review in cubic

ListObjectsV2/V1 with max-keys=0 hit `count >= max_keys` (0 >= 0) on the first
object, setting IsTruncated=true and emitting a continuation token over an
empty last_key (base64("") = ""), which the next request rejects with
InvalidArgument. AWS returns KeyCount=0, IsTruncated=false, no token. Force
is_truncated=false when max-keys=0 in both handlers.

Test: put 2 objects, list with max-keys=0 via V2 and V1 -> empty, not
truncated, no continuation token / NextMarker.
@vieiralucas vieiralucas merged commit ed0462c into main Jun 27, 2026
104 checks passed
@vieiralucas vieiralucas deleted the wt-s3-maxkeys branch June 27, 2026 14:24
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.

1 participant