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

fix(idempotency): skip persistence for optional idempotency key #1507

Merged
merged 9 commits into from
Jun 20, 2023
Merged

fix(idempotency): skip persistence for optional idempotency key #1507

merged 9 commits into from
Jun 20, 2023

Conversation

am29d
Copy link
Contributor

@am29d am29d commented Jun 16, 2023

Description of your changes

I have implemented a skip step within IdempotencyHandler instead of BasePersistenceLayer. The reason for that was to skip the flow as early as possible and avoid any additional overhead on IdempotencyRecord computation. The downside is now the same functionality needs to be ported to the middy implementation, because it does not reuse the IdempotencyHandler logic.

I am don't like the solution, though it solve the problem for now. I think we should refactor the IdempotencyHandler to suite the middy implementation and have one control flow. Open to any suggestion, if there is another way to handle that. The skip step feels like an additional middleware step we can attach to the idempotency, but I lack deeper middy knowledge how we could chain it transparently.

Related issues, RFCs

Issue number: #1501

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

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.

@boring-cyborg boring-cyborg bot added idempotency This item relates to the Idempotency Utility tests PRs that add or change tests labels Jun 16, 2023
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Jun 16, 2023
@github-actions github-actions bot added the bug Something isn't working label Jun 16, 2023
@am29d am29d requested a review from a team as a code owner June 19, 2023 17:00
@am29d am29d requested a review from dreamorosi June 20, 2023 07:58
@am29d am29d merged commit b9fcef6 into aws-powertools:main Jun 20, 2023
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.

2 participants