Skip to content
Astera Technology

Separate webhook replay checks from duplicate delivery

Verify each delivery, then use a durable event record to prevent a completed action running twice.

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.

Synthetic delivery decisions
DeliveryVerificationLedgerAction
EV-21, fresh signed requestPassAbsentClaim then process
EV-21, valid redeliveryPassCompletedAcknowledge without repeating effect
Captured old deliveryOutside configured supported toleranceAny stateReject authentication path
Download editable CSV ↓

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.

Related resources