Skip to content

Extend mesh node staleness window from 10 min to 72 h#119

Merged
d3mocide merged 1 commit into
mainfrom
claude/mesh-node-staleness-kqt72g
Jul 6, 2026
Merged

Extend mesh node staleness window from 10 min to 72 h#119
d3mocide merged 1 commit into
mainfrom
claude/mesh-node-staleness-kqt72g

Conversation

@d3mocide

@d3mocide d3mocide commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Problem

Active mesh nodes — including the primary repeater that feeds the observer node — were rendering grey on the map with a STALE / OFFLINE tooltip despite being live.

A mesh node's last_seen is its last advert timestamp, and MeshCore nodes typically advert only once every 24–48 h. But buildMeshNodeLayer.ts flagged any node whose last advert was older than 10 minutes as stale (STALE_MS = 10 * 60 * 1000). So virtually every healthy-but-quiet node tripped the gate.

Note this threshold does not control map presence — nodes stay visible as long as the MeshCore repeater still lists them (the poller re-publishes the contact table every 60 s, refreshing the 120 s Redis TTL). It only drives the grey icon color and the tooltip label.

Change

  • frontend/src/config.ts — new MESH_NODE_STALE_MS, default 72 h, overridable via VITE_MESH_NODE_STALE_HOURS. 72 h means a node is only marked stale after missing roughly two advert cycles.
  • frontend/src/layers/buildMeshNodeLayer.ts — replace the hardcoded 10-minute constant with the shared config value. Both the grey/active icon color and the STALE / OFFLINE vs ACTIVE / ONLINE tooltip read the same picked object (MeshNodePoint.stale), so both update from this single source.
  • .env.example — document VITE_MESH_NODE_STALE_HOURS=72.

Validation

  • npx tsc --noEmit passes.

🤖 Generated with Claude Code


Generated by Claude Code

A mesh node's last_seen is its last advert timestamp, and MeshCore nodes
typically advert only once every 24-48 h. The map layer flagged any node
whose last advert was older than 10 minutes as STALE / OFFLINE, so nearly
every node — including active repeaters like the primary that feeds the
observer — rendered grey with a STALE / OFFLINE tooltip despite being live.

Replace the hardcoded 10-minute threshold with a configurable window
(MESH_NODE_STALE_MS, default 72 h, override via VITE_MESH_NODE_STALE_HOURS)
so a node is only marked stale after missing roughly two advert cycles.
Both the grey icon color and the tooltip label read the same picked object,
so both update from this single source.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DUSVEY4GGnyyt6PfXMKtR3
@d3mocide
d3mocide marked this pull request as ready for review July 6, 2026 16:49
@d3mocide
d3mocide merged commit 33769b8 into main Jul 6, 2026
6 checks passed
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.

2 participants