Skip to content

AdapterAmazonS3.getFiles silently truncates at 1000 keys (no pagination) #82

@skuehlshelbyMITCS

Description

@skuehlshelbyMITCS

In AdapterAmazonS3.getFiles (v3.0.2, dist/AdapterAmazonS3.js:99), a single ListObjectsCommand is issued with MaxKeys: maxFiles (default 10000). AWS S3 caps MaxKeys at 1000 per request regardless of the requested value, and the response's IsTruncated/NextMarker are not checked. For buckets with more than 1000 objects, callers of listFiles / getFiles silently receive only the first page with no indication of truncation.

Reproduction

  1. Populate an S3 bucket with >1000 objects
  2. Call storage.listFiles() on a Storage configured with the S3 adapter
  3. Result length is 1000, not the actual object count

Suggested fix

Switch to ListObjectsV2Command and loop while IsTruncated is true, passing ContinuationToken: NextContinuationToken until exhausted. The same pattern applies to getFileVersions at dist/AdapterAmazonS3.js:116 (uses ListObjectVersionsCommand with the same missing-pagination issue; IsTruncated + NextKeyMarker / NextVersionIdMarker).

Happy to send a PR if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions