Retry safety means repeated execution after failure does not create unintended additional effects. It matters when one operation combines database writes with independent external network calls. section 7.5
Evaluate each step separately:
- Treat repeated database writes as safe when they are idempotent, such as setting an already-CANCELLED booking to CANCELLED. section 7.5
- Protect external effects with provider-supported idempotency keys; otherwise a timeout and retry can issue a Stripe refund twice. section 7.5
- Check asynchronous work separately because failures after the response can leave users seeing success while reminders or calendar state remain wrong. section 7.5
Cancelling a booking
A process marks a booking CANCELLED, then crashes before refunding the customer. Retrying safely repeats the harmless database update, uses the same Stripe idempotency key, and prevents duplicate webhook scheduling through its unique key. section 7.5
