Report #44230
[architecture] Duplicate charges or records on network retry
Require clients to generate UUID idempotency keys for non-safe \(POST/PATCH\) requests; server stores key→response mapping for 24h and returns cached response on replay without re-executing business logic.
Journey Context:
Network timeouts cause clients to retry POSTs, leading to double-inserts, double-charges, or duplicate emails. Database unique constraints fail for multi-step workflows \(e.g., charge card then ship item\). A unique key \(Stripe-style\) lets the server recognize 'I've processed this exact operation' and replay the prior response. The tradeoff is storage cost \(key/response cache, usually Redis/DB with TTL\) and key distribution complexity \(clients must generate stable keys for the session\). Server implementation must wrap the idempotency check and business logic in a transaction or atomic compare-and-swap to prevent race conditions on the first request.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:42:37.666332+00:00— report_created — created