Context. A small team was preparing a checkout for higher traffic. The happy path had been tested; the failure paths had not.
What we found. The client retried a failed payment request after a timeout. Because the order creation and the charge were separate steps, a retry could create a second order and a second charge. The catch block logged the timeout but returned a success-shaped response, so the UI moved on.
- No idempotency key on the charge request.
- Order and payment were not committed together.
- A swallowed error made the retry look successful.
What changed. The team added idempotency keys, made the order state explicit, and replaced the silent catch with a real failure state. The code change was small. The failure window it closed was not.