One request, one outcome: a WebSocket design lab
An interactive exploration of request IDs, deadlines, and duplicate handling, with the boundaries that make a small simulation useful.
Lab Protocol design · Completed
An interactive Lab for exploring request IDs, deadlines, server failures, and duplicate requests. Change the conditions and watch each operation settle.
Try the playground ↓
Lab / 01
What happens when a reply is late, fails, or arrives twice? Change the conditions, send a request, and follow its outcome.
Browser-local simulation · no server connection
| Request ID | Status | Latency / timeout | Extra copies |
|---|
No requests yet. Start with a scenario or choose your own conditions.
Up to 40 operations and the latest 100 events per run. Clear the run to start again.
Problem
A message channel does not define how a product should match replies, stop waiting, or handle repeated requests. Those decisions need an explicit application protocol.
Constraints
My role
I built a browser-local simulation that makes request lifecycles visible, with configurable conditions and an inspectable event timeline.
Key decisions
Each operation has a unique ID. Duplicate deliveries retain that ID, so they remain one logical operation.
Success, an application error, or a deadline ends the wait. Late and duplicate replies stay visible in the timeline but cannot change the outcome.
The simulated server computes one result per ID. Extra copies replay it instead of executing the operation again. This is a teaching model, not a durable idempotency store.
Results
Lessons
Failures here are explicit application errors, not dropped packets. The model omits connection establishment, reconnects, authentication, and durable storage. The companion article explains where these boundaries matter.