SSE stream silently drops events when a client lags behind the broadcast bus #77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How found: reading
crates/breadboard-server/src/http.rs(eventshandler) while debugging the web client's live indicator. Not triggered.Confidence: medium-high (the code path is clear; it needs a slow client or a burst larger than the broadcast channel's capacity, e.g. a reconcile touching many issues).
Explanation: the handler maps
BroadcastStreamitems withErr(_) => None. ARecvError::Lagged(n)means the client missed n events, but the stream just carries on, so the client never learns it is out of date and doesn't reload. The web client's resync (from BB-82) only runs on reconnect, which never happens here.Fix idea: on
Lagged, emit aresyncevent (or close the stream so EventSource reconnects and the client reloads). Document the event in Documentation.md if a new variant is added.Implemented on
fix/bb-90-sse-lag, PR #79. When the SSE receiver lags, the response now ends so EventSource reconnects and clients can reload the board snapshot. Added a regression test and documented the reconnect contract. Workspace tests, Clippy, and check-docs pass.