Check authenticity and processing state separately
Stripe includes a signed timestamp to mitigate replay attacks. That check does not replace duplicate-event handling. A legitimate retry can carry a fresh delivery signature for an event you already processed. The ledger below is an original local design.
| Delivery | Verification | Ledger | Action |
|---|---|---|---|
| EV-21, fresh signed request | Pass | Absent | Claim then process |
| EV-21, valid redelivery | Pass | Completed | Acknowledge without repeating effect |
| Captured old delivery | Outside configured supported tolerance | Any state | Reject authentication path |
Make claiming an event atomic
Enforce one claim for the scoped event identity. Keep received, processing and completed states distinct. If a worker crashes after an external effect, reconcile that effect before clearing its claim; merely deleting the ledger can repeat it.
Two workers receive the same valid event simultaneously. Is checking “not found” enough?
Show the worked answer
No. Both may observe absence. Use a unique claim/transaction and let the loser follow the recorded state; test that only one business effect occurs.