Does the customer end up with two orders when a response is delayed?
The original implementation failed the “Repeated delivery” check. Expected 1 and observed 2. The corrected implementation met both expectations on the same inputs.
What the control case missed
The ordinary path sees one incoming request and one order. Replaying the same business request produces two transport deliveries with different delivery IDs. Counting those deliveries gives two orders for one checkout.
| Check | Expected | Original | Corrected |
|---|---|---|---|
| Single delivery | 1 | 1 | 1 |
| Repeated delivery | 1 | 2 | 1 |
What to check before merging
Carry the idempotency key through the storage operation. A Set makes the uniqueness rule visible here. In a full system also exercise concurrent submissions and the database constraint that makes the operation atomic.
Reproduce the recorded result
Download the Node.js fixture and run node run.mjs retry-duplicates-order with Node.js 24. Compare the printed JSON with the recorded results. This is a locally executed model of the regression, using synthetic inputs. It covers the rule shown here. Hosted runs, browser behaviour and customer PRs require their own evidence.