[fix] the events feed said Live over a dead socket - #153
Merged
Conversation
The WebSocket had no reconnect — the stats/logs socket next door has had one all along — and the badge reflected only the pause toggle, so a dropped connection left a pulsing green "Live" above a list that would never move again. An empty feed reads as "nothing is happening", which is why nobody would have noticed. It reconnects on the same 1.5s the shared socket uses, stops reconnecting when the page goes away, and the badge now reports the connection. Also two documentation claims that described the backend rather than the app: README listed a container "kill" action with no button anywhere, and the images page promised a build-args field the dialog does not have. Both said plainly, with the No cache checkbox that IS there documented instead. Found by an inventory pass over the whole manual.
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The events feed said Live over a dead connection.
Its WebSocket had no reconnect at all — the stats/logs socket next door (
web/src/lib/ws.ts) has had one all along — so a server restart, a reverse-proxy idle timeout or a laptop waking from sleep left the page showing a pulsing green badge above a list that would never move again.Worse, the badge reflected only the pause toggle, not the connection. So the page actively asserted it was live while the socket was gone. That is the worst shape this bug can take: an empty feed reads as "nothing is happening", so nobody looks closer.
Also
Two documentation claims that described the backend rather than the app. Both are corrected here and the controls themselves are added in a separate PR:
README.mdlisted a container kill action; no button existed anywhere.docs/images.mdpromised a build args field the dialog did not have. The No cache checkbox that is there was undocumented.Tests
New
web/src/pages/Events.dom.test.tsx, five cases: it does not claim to be live before the socket opens, says Live once connected, stops claiming it on a drop, reconnects and says Live again, and does not reconnect after unmount.Mutation-verified: removing the reconnect fails one test; restoring the pause-only badge fails two.
Type of change
Checklist
go test -short ./...andgo vet ./...pass (unchanged — no Go)gofmtgate is clean (no Go files touched)web/distCHANGELOG.mdentryNotes for reviewers
Found by a documentation-vs-code audit, in the direction that only an inventory finds: not "is this claim true?" but "what does the app do that no page mentions?". The events page turned out to have a real defect rather than a documentation gap.
Worth checking whether the same shape exists elsewhere — any
new WebSocket(outsidelib/ws.ts. I believe this was the only one, but a second pair of eyes on that grep is cheap.