Double-charge on Pay
acme-storefront · Issue #381 · Next.js · pnpm
Customers were billed twice when they double-clicked Pay. The form fired two POST /charges before the first response landed. Infinite reproduced it against a test charge, added an idempotency key on the client, enforced it server-side, and covered both paths.
- ReproduceDouble-submit against a test charge. Two POSTs, one intent.
- Edit
charges.tsandPayButton.tsx. Idempotency key in the request and on the server. - Test
pnpm test· 214 passed, including the double-click path. - PROpened #392 with a plain-language summary. Waiting on review.