Skip to content

feat(web-console): humanised activity view and connection health - #307

Closed
Mearman wants to merge 16 commits into
feat/console-trustfrom
feat/console-activity
Closed

Mearman wants to merge 16 commits into
feat/console-trustfrom
feat/console-activity

Conversation

@Mearman

@Mearman Mearman commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Stacked on #306 (base is feat/console-trust, so CI does not run for this PR; verification was local).

The connection panel now tells a person what happened instead of only printing frames. activity.ts turns the session's state changes and frames into sentences (connecting, connected, handshake negotiated or unanswered, connection lost and each failed retry, pairing established, relayed messages to or from a peer, peers seen in gossip, node closed the connection), with peers named through the naming convention from #305. A certificate change announced by that connection's node (#306) is merged into the same log. The raw frame log is still there behind a "Show raw frames" switch. The session's event stream has a single reader, so the activity is accumulated inside useMeshSessionEvents from the same events, which now takes the clock and returns the event, the activity and when the status last changed.

Health no longer needs the ping button. useConnectionHealth sends a measured ping when the connection comes up and every 15 s after, records each pong as a sample for the sparkline and each unanswered probe as a loss tick, and stops probing a node whose first probe got no pong, because only relay hubs answer pings and probing a plain peer would only fill its frame log; a manual "Send ping" (now also measured) revives it if the node does answer. A probe that failed only because the connection dropped is not counted as a loss. While reconnecting, the panel says when the next attempt is due and how many remain, computed from the same reconnectPolicy the session uses (moved out of App.tsx into reconnect-policy.ts so both read one definition). The directory's raw snapshot column is now "last seen", a relative time from the peer's advertised snapshot, so it follows the peer's own clock; its tooltip says so.

Two behaviours worth knowing. A dismissed certificate change alert stays in the connection's activity: only the alert is hidden, the record is kept. The health hook takes an optional probe timing argument so its tests can run with real, tiny intervals, because faking timers fought with React's scheduler in jsdom.

The reconnect Playwright specs count handshakes in the raw frame log, so they now switch it on first (a later commit on this branch), and the unresponsive-node unit test no longer depends on interval timing, which made it flaky under load. They could only be run at the top of the stack, where they pass.

Fixes #297

The connection panel shows what happened on a connection as sentences
(connected, handshake, pairing established, relayed messages, peers seen,
certificate changes) derived from the session's state changes and frames,
with the raw frame log behind a toggle. Health is measured without a
button press: a ping probes the node when the connection comes up and on
an interval, each pong becoming a sample in an RTT sparkline and each
unanswered probe a recorded loss; a node that never answers is left
alone. A dropped connection shows when the next attempt is due and how
many remain, from the same reconnect policy the session uses, and the
directory shows when each peer was last seen.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-30T19:31:45.049485Z 019ca84 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

# Conflicts:
#	ts/packages/web-console/src/components/ConnectionPanel.tsx
#	ts/packages/web-console/src/hooks/use-certificate-trust.ts
A ping given up on at its timeout and a ping cut short by a dropped
connection both rejected with a plain Error, so a caller counting
unanswered pings could only tell them apart by message text.
# Conflicts:
#	ts/packages/web-console/test/App.unit.test.tsx
@Mearman

Mearman commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

These commits landed in main as part of #316, which carried the whole console stack as one branch so it needed a single CI cycle against a moving main.

@Mearman Mearman closed this Oct 1, 2026
@Mearman
Mearman deleted the feat/console-activity branch October 1, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant