Aller au contenu
#0911
Containers

The live blog is an append endpoint, and a retry can't double-post

Election night. The live blog is a page node in the newsroom's notebook. The wire script POSTs to document/append with a text block and an X-Idempotency-Key built from the wire item's id. The block lands at the end; the server assigns its id and index and rejects any it is handed.

The uplink hiccups. The script retries with the same key and body, and the server replays the original response instead of appending twice. Same key, different body: 409, a new post wearing an old receipt.

Three editors have the page open over the realtime WebSocket. They see the paragraph land, tighten it, keep going. The bot writes at the end; humans write everywhere else.

No queue, no dedup table, no "did that post twice" at 23:40.

The retry is safe because the key is part of the request, not the process.