Skip to content

fix(idempotency): include sk in error msgs when using composite key #3709

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

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR updates the IdempotencyRecord class so that it optionally accepts a sortKey parameter. This parameter is provided only when using the DynamoDBPersistenceLayer and when using a composite key (pk + sk).

This fixes a bug that prevented the IdempotencyAlreadyInProgressError and IdempotencyItemAlreadyExistsError from constructing the appropriate error message. Both errors now include both keys in the error message, making it easier for customers to detect idempotent requests or troubleshoot issues.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: fixes #3691


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi requested review from am29d and phipag March 11, 2025 09:51
@dreamorosi dreamorosi self-assigned this Mar 11, 2025
@boring-cyborg boring-cyborg bot added idempotency This item relates to the Idempotency Utility tests PRs that add or change tests labels Mar 11, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Mar 11, 2025
@github-actions github-actions bot added the bug Something isn't working label Mar 11, 2025
@dreamorosi
Copy link
Contributor Author

Copy link
Contributor

@am29d am29d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@am29d am29d merged commit 661f5ff into main Mar 11, 2025
85 checks passed
@am29d am29d deleted the fix/dynamodb_sk_messages branch March 11, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working idempotency This item relates to the Idempotency Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Incorrect error message for IdempotencyAlreadyInProgressError when sortKeyAttr is in use
3 participants