Skip to content
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

Bug: Treat missing idempotency key as non-idempotent transaction #1200

Closed
jeromevdl opened this issue Jun 15, 2023 · 2 comments
Closed

Bug: Treat missing idempotency key as non-idempotent transaction #1200

jeromevdl opened this issue Jun 15, 2023 · 2 comments
Labels
bug Something isn't working triage

Comments

@jeromevdl
Copy link
Contributor

Should not store data in persistence store when idempotency key is null.

Expected Behavior

By default, treat a transaction that is missing idempotency key as a NO-OP transaction. That means, we will continue to log a warning and will not save at the configured persistence storage layer.

This prevents mistakes when an application is designed to optionally send a unique value (e.g., X-Idempotency-Value) and NULL doesn't get a unique sentinel value (e.g., UUID) in its absence.

Current Behavior

By default,ThrowOnNoIdempotencyKey is set to false. This means we will log a warning when the idempotency key is missing, since we don't know if that's intentional or not. However we continue treating the transaction like we normally would, hash the null value, and save it in the persistence store.

Test that confirms this behaviour.

Possible Solution

aws-powertools/powertools-lambda-typescript#1501

Steps to Reproduce (for bugs)

  1. Call the lambda handler twice with a null idempotency key

Environment

  • Powertools for AWS Lambda (Java) version used: <=1.15
  • Packaging format (Layers, Maven/Gradle): *
  • AWS Lambda function runtime: *
  • Debugging logs
@jeromevdl jeromevdl added bug Something isn't working triage labels Jun 15, 2023
jeromevdl added a commit that referenced this issue Jun 15, 2023
jeromevdl added a commit that referenced this issue Jun 15, 2023
@jeromevdl
Copy link
Contributor Author

Fixed with #1201

@scottgerring
Copy link
Contributor

Released in 1.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants