Skip to content

Enhacement: Improve error message for IdempotencyAlreadyInProgressError when using a DynamoDB composite key #1800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phipag opened this issue Mar 11, 2025 · 0 comments
Labels
feature-request New feature or request idempotency v2 Version 2

Comments

@phipag
Copy link
Contributor

phipag commented Mar 11, 2025

Related issue in TypeScript: aws-powertools/powertools-lambda-typescript#3691.

When an idempotency operation is already in progress an IdempotencyAlreadyInProgressException exception is raised here: https://github.com/aws-powertools/powertools-lambda-java/blob/v2/powertools-idempotency/powertools-idempotency-core/src/main/java/software/amazon/lambda/powertools/idempotency/internal/IdempotencyHandler.java#L162.

This issue suggests to improve the error message when using a sort key in DynamoDB.

The implementation should not introduce a coupling between data store and idempotency handling!. See discussion: aws-powertools/powertools-lambda-typescript#3691 (comment).

Current behavior

Currently, the exception only contains the idempotency key. This key is dynamically determined in Java and is either the primary key (if the user doesn't use composite keys) or the sort key (if the user uses composite keys).

In the composite key configuration this is not enough to identify the item uniquely in DynamoDB and requires the users to have deep knowledge of the Powertools implementation to realize that the primary key is kept fixed which is not a good developer experience.

Desired behavior

Quoting @dreamorosi from aws-powertools/powertools-lambda-typescript#3691:

  • There is already an execution in progress with idempotency key: idempotencyKey and sort key: sk (when using composite key)
  • There is already an execution in progress with idempotency key: idempotencyKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request idempotency v2 Version 2
Projects
Status: Backlog
Development

No branches or pull requests

1 participant