Skip to content

feat(#884): add X-Idempotent-Replayed header to idempotency middleware#978

Merged
ogazboiz merged 1 commit into
LabsCrypt:mainfrom
B-Hands:feat/issue-884-idempotent-replayed-header
May 28, 2026
Merged

feat(#884): add X-Idempotent-Replayed header to idempotency middleware#978
ogazboiz merged 1 commit into
LabsCrypt:mainfrom
B-Hands:feat/issue-884-idempotent-replayed-header

Conversation

@Anuoluwapo25
Copy link
Copy Markdown
Contributor

  • Cache hit → X-Idempotent-Replayed: true (alongside existing X-Idempotency-Cache: HIT)
  • Fresh exec → X-Idempotent-Replayed: false (set before next() so header is present in every response that carries an Idempotency-Key)
  • Lets the frontend de-duplicate toasts and avoid double-counting without consulting two separate headers
  • Add two new unit tests asserting both header values
  • Add docs/wiki/api-idempotency.md documenting both response headers, TTL, cached status-code policy, and a TS usage example
    closes [Backend] Set X-Idempotent-Replayed response header from idempotency middleware #884

…middleware

- Cache hit  → X-Idempotent-Replayed: true  (alongside existing X-Idempotency-Cache: HIT)
- Fresh exec → X-Idempotent-Replayed: false (set before next() so header
  is present in every response that carries an Idempotency-Key)
- Lets the frontend de-duplicate toasts and avoid double-counting
  without consulting two separate headers
- Add two new unit tests asserting both header values
- Add docs/wiki/api-idempotency.md documenting both response headers,
  TTL, cached status-code policy, and a TS usage example
@ogazboiz ogazboiz merged commit f3fbcf0 into LabsCrypt:main May 28, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Set X-Idempotent-Replayed response header from idempotency middleware

2 participants