WebSocket Lab

Durable idempotency: one message ID can execute at most one operation.

Disconnected
Pending acknowledgements: 0

The server persists the operation before deliberately dropping the ACK. Retrying uses the same ID.

Protocol view

A live schematic of the WebSocket conversation and PostgreSQL decision.

Client

Browser

Connectionconnecting
Pending map0 messages
Creates IDsyes
MESSAGE →
← ACK
Server

Node + ws

Actionwaiting
Last IDnone
Operationnone
Idempotencywaiting
Database

PostgreSQL

Transactionkey + result
Unique constraintmessage_id
Decisionwaiting
Stored operationnone

Latest protocol envelope

No application message sent yet.

Event timeline