Guided · beginner · 25 min · Free · no account
The webhook that fires twice
Halvard Freight's carrier webhook created two invoices for one delivery. Find the duplicate in the logs, explain why the carrier retried, and make the billing write safe to repeat.
Brief
- Customer
- Halvard Freight (synthetic customer; every log and payload on this box is made up for the exercise)
- Situation
- Halvard's ops lead messaged at 08:50: three customers were invoiced twice for last night's deliveries. The integration you inherited last week receives
shipment.deliveredwebhooks from the carrier and posts an invoice to Halvard's billing service for each one. Nobody changed the code. The carrier says nothing is wrong on their side. - Your role
- You are the FDE on the Halvard engagement, working on the integration box
halvard-int-01. You may read anything, edit the receiver's config, and replay recorded webhook payloads. The billing service on this box is a simulator with the same contract as the real one. - Goal
- Name the event that was delivered twice, explain why the carrier retried, and change the integration so that replaying the same event never creates a second invoice. Prove it by replaying both recorded deliveries.
Objectives
- 1.Identify the event that was delivered twice and answer with its event_id (you commit to an answer)
- 2.Explain why the carrier sent it twice (you commit to an answer)
- 3.Make the billing write idempotent on the identifier that survives a retry
- 4.Replay both recorded deliveries of the duplicated event and show that only one invoice is created, and let the live duplicates stop
Mission console
The console opens full screen: the customer's system on the left (topology, traces, metrics, queue, logs), your terminal, the sandbox and the mission on the right. Nothing you type leaves your browser; the world is deterministic, and reset puts everything back.
about 25 min · 12 steps at par
