Skip to content

fix(idempotency): keep payload validation hash on cache record completion - #5706

Merged
svozza merged 2 commits into
mainfrom
fix/idempotency-cache-validation-hash
Sep 13, 2026
Merged

svozza merged 2 commits into
mainfrom
fix/idempotency-cache-validation-hash

Conversation

@svozza

@svozza svozza commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

CachePersistenceLayer._updateRecord() rewrote the whole Redis/Valkey value with only status, expiry, and response data, dropping the payload validation hash written with the in-progress record. With payloadValidationJmesPath configured, an identical retry of a completed operation then failed with IdempotencyValidationError whenever the local cache did not hold the record. The completed record now keeps the validation attribute, matching the DynamoDB adapter.

Changes

  • Serialize in-progress and completed cache records through a single private #encodeRecord() helper so both writes share one shape, including the validation attribute when payload validation is enabled
  • Add a unit test asserting that a completed record written with payload validation retains its validation field

Issue number: closes #5705


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.

@svozza
svozza merged commit c0dac7a into main Sep 13, 2026
41 checks passed
@svozza
svozza deleted the fix/idempotency-cache-validation-hash branch September 13, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Idempotency cache persistence drops the payload validation hash when a record completes

2 participants