-
Notifications
You must be signed in to change notification settings - Fork 156
fix(idempotency): validate idempotency record returned in conditional write #2083
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
Conversation
Adding this for visibility: aws-powertools/powertools-lambda-python#3781 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this bugfix so quickly! I left a comment on some logic that may be good to include here as well, or potentially as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suuuperb!
|
Description of your changes
This PR fixes a bug that was introduced in the last release and that caused the Idempotency utility to skip the validation of a payload on subsequent requests.
In order to leverage the new capability of
ConditionalCheckFailedException
to return the item that made the conditional check to fail, we had to implement a logic that sort of looks like this:The pseudo-
saveRecord
from the chart above is called by theIdempotencyHandler
, which handled it this way:As you can see from the flow above, in one of the paths the payload was never validated.
This PR changes the access property of the
validatePayload
method fromprivate
topublic
so that it's exposed on the persistence layer and can be called directly by theIdempotencyHandler
.The flow now looks like this:
Related issues, RFCs
Issue number: #2058
Checklist
Breaking change checklist
Is it a breaking change?: NO
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.