Skip to content

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Jul 18, 2025

Issue

#7217

Description

This fix supports reuse of Command class instances, particularly in the special case of the @aws-sdk/lib-dynamodb DynamoDBDocumentClient.

Currently, the reuse of Command class instances is undefined behavior.

Example of command reuse:

import { DynamoDBDocumentClient, GetCommand } from "@aws-sdk/lib-dynamodb";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

const ddb = new DynamoDBClient();
const doc = DynamoDBDocumentClient.from(ddb);

const get = new GetCommand({ ... });

await doc.send(get);
await doc.send(get);

https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/javascript_dynamodb_code_examples.html

We had previously expected each send call to receive a new instance of the Command in question, but now recognize the possibility of reusing command instances.

Testing

added integ tests

@kuhe kuhe requested a review from a team as a code owner July 18, 2025 20:39
@zshzbh zshzbh linked an issue Jul 18, 2025 that may be closed by this pull request
4 tasks
@kuhe kuhe force-pushed the fix/command-reuse branch from d2bb8a0 to e042379 Compare July 18, 2025 22:14
@kuhe kuhe force-pushed the fix/command-reuse branch from e042379 to d22b285 Compare July 18, 2025 22:17
@kuhe kuhe merged commit 24e5b28 into aws:main Jul 21, 2025
4 checks passed
@kuhe kuhe deleted the fix/command-reuse branch July 21, 2025 14:47
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants