fix(frontend): relay-aware staleness for infra nodes + dim-not-delete (#1598, PR A) - #1815
fix(frontend): relay-aware staleness for infra nodes + dim-not-delete (#1598, PR A)#1815Saarlandpower wants to merge 3 commits into
Conversation
…Kpa-clawbot#1598) Implements PR A from the Kpa-clawbot#1598 triage fix path (r6, decisions locked): - getNodeStatus() now accepts a full node object (legacy (role, lastSeenMs) signature still works). For infra roles (repeater/room), freshness is max(advert-based timestamp, last_relayed), so actively-relaying backbone repeaters with long/disabled advert intervals are no longer marked stale. - pruneStaleNodes() in the Live view dims repeater/room markers instead of deleting them, regardless of _fromAPI origin. - All seven getNodeStatus call sites (nodes.js, map.js, live.js) pass the node object; nodes.js status explanation surfaces 'Last relayed' when relay participation is the fresher signal. - Unit tests incl. the backbone-repeater fixture from triage (last_seen=25h, last_relayed=5min -> active). Empirical motivation: four operator deployments confirm 88% of infra nodes with last_relayed > last_seen; on live.saarmesh.de 160 infra nodes exceed even infraSilentMs=72h while actively relaying. Co-Authored-By: Claude <noreply@anthropic.com>
…t-delete + relay-aware fixture Co-Authored-By: Claude <noreply@anthropic.com>
Bot polish reviewVerdict: MERGE-READY Findings
Persona votes
Merge gate
Automated polish review. Human maintainer makes the final call. This is a clean, well-tested change; the MINORs are follow-up material, not merge blockers. |
|
Cross-referencing today's triage rounds on #1611, since they land on this PR. The #1611 re-triage this morning concluded that the cadence-adaptive threshold should be split out as a separate follow-up, and that the #1598 r6 fix is the critical path to ship first — assessed at effort S, described as a That implementation is this PR. Open since 2026-07-01, bot review MERGE-READY since 2026-07-02, implementing all three locked r6 decisions:
No rush intended; flagging it only because the design discussion has now converged on this change three times today across #1611, #1845 and #1598, and it may not be obvious that the code is already sitting here. Happy to rebase if it has drifted against master. |
Delta re-review —
|
Implements PR A from the #1598 triage fix path (r6 — all three operator decisions locked: confidence ≥0.75 [PR B], dim-not-delete, in-place
getNodeStatussignature extension).Changes
public/roles.js—getNodeStatus()(role, lastSeenMs)signature keeps working unchanged.max(advert-based timestamp, last_relayed). Freshness precedence mirrors existing call sites:_liveSeen>_lastHeard>last_heard>last_seen.last_relayedis only consulted for infra — companions keep pure advert/heard-based staleness (per @liquidraver's collision caveat; the ≥0.75-confidence_liveSeenrefresh is PR B).public/live.js—pruneStaleNodes()_fromAPIorigin. WS-only non-infra nodes are still removed to prevent unbounded memory growth.Call sites — all seven (
nodes.js×3,map.js×3,live.js×1) now pass the node object. The Nodes-page status explanation shows "Last relayed …" when relay participation is the fresher signal, so an Active badge next to an old "last heard" isn't confusing.Tests — 16 new
getNodeStatusunit tests incl. the triage's backbone-repeater fixture (last_seen=25h,last_relayed=5min →active);pruneStaleNodestests updated for dim-not-delete plus a new relay-aware prune test.Test results
node test-frontend-helpers.js: 641 passed, 2 failed — the 2 failures (favStar ★ assertions) are pre-existing on current master (verified on a clean upstream clone).Validation offer
live.saarmesh.de currently has 160 infra nodes past
infraSilentMs=72h while actively relaying (incl. KatS disaster-relief repeaters) — a ready-made test population. Happy to run this branch there and report before/after node visibility.Refs #1598 (PR A of two; PR B =
_liveSeenrefresh onresolved_path≥0.75 confidence).