-
Notifications
You must be signed in to change notification settings - Fork 153
feat(idempotency): add support for custom key prefix #3532
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
feat(idempotency): add support for custom key prefix #3532
Conversation
Hi @shdq, hope you're doing well! I wanted to ask if you need any help with this. If things got busy on your end it's perfectly fine, perhaps I could push a couple commits to your branch and get the PR merged next week. |
Hey Andrea The changes brought by this PR with the custom prefix added to:
If we need to cover any extra cases let me know. Everything seems ready except for the documentation. Where should I add the docs? I want to finalize it and merge the PR next week, so let's work closer on this one. Don't hesitate to reach out on Discord, it would be faster. Have a great weekend! |
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.
Thank you for the updates @shdq, I have checked out the branch locally, built the package, and tested it in a side project and could verify that everything works as expected.
I have left a couple comments on the tests, they're all minor and only around test naming for better consistency/clarity.
In terms of documentation, I would add a new section before or after this one. If you think there's a better order I'm open for suggestions, but overall I'd keep it under "Advanced".
When it comes to content, you can copy and adapt the one from the Python docs, which is here. Feel free to simplify the code sample to focus it on the new feature.
packages/idempotency/tests/unit/persistence/BasePersistenceLayer.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrea Amorosi <[email protected]>
|
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.
Thank you for addressing my comments, I'll open a new PR to add the docs separately.
Summary
This allows users to define a custom static idempotency key prefix, making it easier to refactor or group functions under the same idempotency key space
Changes
This PR introduces support for customizing the idempotency key prefix in the
makeIdempotent
function andmakeHandlerIdempotent
for middleware. Previously, the key prefix was hardcoded based on the function’s location, limiting flexibility.All three usage of lambda are covered:
makeIdempotent
function@idempotent
middy
middlewareExamples:
Issue number: closes #3515
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.