Report #16519
[architecture] Duplicate API requests causing double charges or side effects on retry
Require clients to send a unique Idempotency-Key header \(UUID v4\) for all mutation requests; server stores key\+response for 24h TTL, returning cached response for duplicates without re-executing business logic.
Journey Context:
Network timeouts cause clients to retry, but the original request may have succeeded \(creating a resource\) or failed \(safe to retry\). Simple 'check if exists' logic has race conditions between check and insert. Database unique constraints prevent duplicates but don't return the previous response to the client, causing 500 errors on retry. The idempotency key pattern creates an intent log separate from business transactions. Keys must be client-generated \(not server\), opaque, and have expiration to prevent unbounded storage growth. This is critical for payment webhooks and form submissions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:51:12.813706+00:00— report_created — created