Hydra
Bug library · concurrency · flow

Double submit

The Pay button stays enabled while processing and each click gets a new idempotency key, so a double click creates two orders.

Breaks: double-click · expected from Kane: missed · Kane clicks Pay once, as the spec says; the bug only shows on a double click.

The diff

components/Checkout.tsx
- body: JSON.stringify({ cart: lines, coupon, ...details, idempotencyKey: idempotencyKey.current }),
+ body: JSON.stringify({ cart: lines, coupon, ...details, idempotencyKey: newKey() }),
components/PaymentForm.tsx
- if (pending || disabled) return;
+ if (disabled) return;
components/PaymentForm.tsx
- className="primary" disabled={disabled || pending}
+ className="primary" disabled={disabled}

Matches

No recorded match has planted this bug yet.