Description
src/hooks/useSSE.ts registers three addEventListener listeners on the EventSource but never sets an onerror handler. When the SSE connection drops or the server is unreachable, the browser silently retries in the background — users continue seeing the dashboard with no indication that live data may be stale.
Current code
const es = new EventSource(SSE_URL);
es.addEventListener("event", () => { ... });
es.addEventListener("miner", () => { ... });
es.addEventListener("swap", () => { ... });
// No es.onerror handler
Expected Behavior
An onerror handler should be registered so the application can:
- Log the connection failure for debugging
- Optionally surface a UI indicator (e.g. a stale-data banner or connection-lost toast) when the SSE feed is broken
Actual Behavior
SSE errors are swallowed. A user whose connection drops sees the dashboard frozen on the last snapshot with no feedback, and has no way to know the live feed is disconnected.
File
src/hooks/useSSE.ts
Description
src/hooks/useSSE.tsregisters threeaddEventListenerlisteners on theEventSourcebut never sets anonerrorhandler. When the SSE connection drops or the server is unreachable, the browser silently retries in the background — users continue seeing the dashboard with no indication that live data may be stale.Current code
Expected Behavior
An
onerrorhandler should be registered so the application can:Actual Behavior
SSE errors are swallowed. A user whose connection drops sees the dashboard frozen on the last snapshot with no feedback, and has no way to know the live feed is disconnected.
File
src/hooks/useSSE.ts