From dbb52e0a368ce93df3fd19f9b6d6fc80626ce904 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Feb 2026 12:35:19 +0000 Subject: [PATCH] story-kit: create 138_bug_no_heartbeat_to_detect_stale_websocket_connections --- ...t_to_detect_stale_websocket_connections.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .story_kit/work/1_upcoming/138_bug_no_heartbeat_to_detect_stale_websocket_connections.md diff --git a/.story_kit/work/1_upcoming/138_bug_no_heartbeat_to_detect_stale_websocket_connections.md b/.story_kit/work/1_upcoming/138_bug_no_heartbeat_to_detect_stale_websocket_connections.md new file mode 100644 index 0000000..35ee96e --- /dev/null +++ b/.story_kit/work/1_upcoming/138_bug_no_heartbeat_to_detect_stale_websocket_connections.md @@ -0,0 +1,30 @@ +--- +name: "No heartbeat to detect stale WebSocket connections" +--- + +# Bug 138: No heartbeat to detect stale WebSocket connections + +## Description + +The WebSocket client in frontend/src/api/client.ts only reconnects when the onclose event fires. If the connection half-closes (appears open but stops receiving data), onclose never fires and reconnection never happens. There is no ping/pong heartbeat mechanism to detect this state. + +## How to Reproduce + +1. Open the web UI and establish a WebSocket connection +2. Wait for a network disruption or half-close scenario +3. The connection appears open but stops delivering messages +4. No reconnection is attempted + +## Actual Result + +The frontend keeps a dead WebSocket open indefinitely with no way to detect it has stopped receiving data. UI becomes permanently stale until manual refresh. + +## Expected Result + +A heartbeat mechanism should detect stale connections and trigger automatic reconnection. + +## Acceptance Criteria + +- [ ] WebSocket client implements a periodic heartbeat/ping to detect stale connections +- [ ] Stale connections are automatically closed and reconnected +- [ ] Server responds to ping frames or implements server-side keepalive