Handle Event Replay, Reordering, and Durable Effects
Combine freshness, durable deduplication, semantic binding, state transitions, and an outbox when events trigger external work.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
A fresh signed event can still be a replay
Webhook providers retry. Networks lose acknowledgments. A malicious sender who can replay a captured valid delivery may also submit it again within the accepted timestamp window. Signature verification and freshness establish authenticity and age; neither makes the business effect one-time.
CreditHarbor receives a correctly signed payment event for a valid merchant and order. The handler increments a credit balance every time it sees payment.settled. Delivering the same event twice adds credits twice even though both signatures and timestamps are valid.
Initial credits: 0
Event evt-41: authentic, fresh, correct order → +50
Same evt-41 again within five minutes → +50 again
Final credits: 100 for one paid event