Skip to content

fix(idempotency): ensure unique idempotency keys for multiple methods with same key#1124

Merged
hjgraca merged 1 commit intodevelopfrom
fix/idempotency-key-name
Jan 29, 2026
Merged

fix(idempotency): ensure unique idempotency keys for multiple methods with same key#1124
hjgraca merged 1 commit intodevelopfrom
fix/idempotency-key-name

Conversation

@hjgraca
Copy link
Contributor

@hjgraca hjgraca commented Jan 26, 2026

Please provide the issue number

Issue number: #1123

Summary

Changes

  • Refactor BasePersistenceStore to use AsyncLocal for full function name, supporting multiple idempotent methods in the same Lambda
  • Add SetFullFunctionName to correctly isolate keys per method
  • Update key generation to use method-specific names
  • Add test for multiple idempotent methods with same key to verify separate records are created
  • Add GetAllKeys to InMemoryPersistenceStore for test/debug support

User experience

Please share what the user experience looks like before and after this change

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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.

… with same key

- Refactor BasePersistenceStore to use AsyncLocal for full function name, supporting multiple idempotent methods in the same Lambda
- Add SetFullFunctionName to correctly isolate keys per method
- Update key generation to use method-specific names
- Add test for multiple idempotent methods with same key to verify separate records are created
- Add GetAllKeys to InMemoryPersistenceStore for test/debug support
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 26, 2026
@github-actions github-actions bot added the bug Unexpected, reproducible and unintended software behaviour label Jan 26, 2026
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 81.08108% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.23%. Comparing base (989220b) to head (4149c81).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
...ls.Idempotency/Persistence/BasePersistenceStore.cs 81.08% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1124      +/-   ##
===========================================
- Coverage    79.23%   79.23%   -0.01%     
===========================================
  Files          299      299              
  Lines        12441    12451      +10     
  Branches      1490     1488       -2     
===========================================
+ Hits          9858     9865       +7     
- Misses        2128     2131       +3     
  Partials       455      455              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dreamorosi
Copy link
Contributor

Hi there I'll review this tomorrow morning

@hjgraca hjgraca merged commit fe53e3a into develop Jan 29, 2026
9 of 10 checks passed
@hjgraca hjgraca deleted the fix/idempotency-key-name branch January 29, 2026 10:02
@hjgraca hjgraca linked an issue Jan 29, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/idempotency bug Unexpected, reproducible and unintended software behaviour size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to have multiple Idempotent methods in the same lambda

2 participants