Description
Expected Behavior
When an IdempotencyAlreadyInProgressError
is thrown, the error message should include the hashed key information.
Current Behavior
Currently, the error message only includes the partition key, but when a sortKeyAttr
has been provided in the config the partition key is a static string. The leads to meaningless errors in the log that all say there's a IdempotencyAlreadyInProgressError
error for the same key.
Code snippet
// none
Steps to Reproduce
Set up idempotency and provide a sortKeyAttr
in the config, then send duplicate events in quick succession. You will get errors that reference only the partition key, but the partition key is static in this scenario and is therefore not very helpful for debugging.
Possible Solution
Include both the pk/sk, or detect the current scenario better and include the more meaningful one.
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status