Guard runtime websocket sends against state races

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-09 23:50:58 +00:00
1 parent 8f2e258849
commit f04d1204f9
1 file changed
+5 -1
+5 -1
View File
@@ -142,7 +142,11 @@ function sendMessage(socket: WebSocket, message: unknown): void {
return;
}
socket.send(JSON.stringify(message));
try {
socket.send(JSON.stringify(message));
} catch {
// Best-effort event delivery. Socket may have transitioned states.
}
}
function decodeClientMessage(raw: RawData): string | null {