Report #3851
[architecture] Duplicate webhook deliveries causing double-charges or duplicate order processing
Store the webhook's unique ID \(Idempotency-Key header or event ID\) in a column with a UNIQUE database constraint before processing; return 200 OK immediately if a duplicate key violation occurs, treating it as success.
Journey Context:
Developers often rely on database transactions alone, but that only protects against retries within the same connection, not external retries from the webhook provider. Simply checking 'if exists' before inserting is race-condition prone under concurrent load. The unique constraint makes the check-and-set atomic. This handles the 'at least once' delivery guarantee that all major webhook providers \(Stripe, Shopify, GitHub\) enforce. Tradeoff: you need to persist the idempotency key for as long as the webhook provider might retry \(usually 24 hours to 30 days\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:20:04.922088+00:00— report_created — created