Skip to content

Implicit pagination for deletes #7087

Closed as not planned
Closed as not planned
@jakeleventhal

Description

@jakeleventhal

Checkboxes for prior research

Describe the bug

This error happens when you try to delete too many objects. To get around this I have this code:

    const client = this.getS3Client();
    const bucket = AWS.S3_BUCKET_NAMES[bucketType];
    const chunks = _.chunk(objectKeys, 1000);

    await Promise.all(
      chunks.map((chunkedKeys) =>
        client.send(
          new DeleteObjectsCommand({
            Bucket: bucket,
            Delete: {
              Objects: chunkedKeys.map((key) => ({ Key: key }))
            }
          })
        )
      )
    );

This code should be implicit and implemented under the hood for the delete objects command.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-s3@3.741.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.15.0

Reproduction Steps

See above

Observed Behavior

See above

Expected Behavior

See above

Possible Solution

See above

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions