The limit that limits nothing · 9 of 20

Every write that can be retried must be idempotent

Our code and the research
Check it
stripe trigger payment_intent.succeeded   # then resend the same event from the dashboard# expect one row, not two; expect 400 for a forged signature
Free, no call

Get every Fix AI Slop Code episode

The code it wrote, the code it should have written and a check, for every episode

Free, straight to your inbox. No call, no pitch

What is going on

Platforms retry on your behalf: Stripe redelivers a webhook for up to three days, Slack resends if you do not answer in three seconds, Vercel can fire the same cron twice or start a second instance while the first runs. A handler that charges, sends, or deploys once per delivery will do it twice.

Where it bit

The lead-gen cron ran wrangler pages deploy unconditionally on every tick, with the wrangler account cache committed to the repo. Fixed with a token guard and by untracking the cache. In the research: two PaymentIntents four seconds apart for the same customer is the canonical receipt.

The practice

Acknowledge fast, queue the work, and put a UNIQUE constraint on the event id (evt_, update_id, the Slack event id). Send an Idempotency-Key per order on every Stripe POST. Deploys and jobs take a lock (flock -n, Redis SET NX, pg_advisory_lock).

Free, no call

Get this check as a script you can run tonight

Free, straight to your inbox. No call, no pitch

What to do with this

If this check came back with more than you expected, that is worth a conversation

Book a free 30-minute call