Real-time transcription: how to recover state when the WebSocket drops mid-sentence

tresch_24 · reddit · 2026-09-17

A developer building a real-time transcription pipeline (audio → backend WebSocket → Smallest AI Pulse → transcript events → app state) raises a core engineering question: when the socket dies mid-sentence and reconnects 800ms later, should you replay audio, start fresh, or wait for a late final from the old stream? Replaying can duplicate transcript text; not replaying may eat the exact word you needed — worse when a partial already mutated UI/state. The author's proposed fix: give each segment its own seq/id plus idempotent downstream handling, so one reconnect doesn't turn into state archaeology. He'd take another 300ms of latency over duplicated state any day.

Original post →

More from coding & agent

coding & agent channel →