Extend mesh node staleness window from 10 min to 72 h#119
Merged
Conversation
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
marked this pull request as ready for review
July 6, 2026 16:49
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.
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_seenis its last advert timestamp, and MeshCore nodes typically advert only once every 24–48 h. ButbuildMeshNodeLayer.tsflagged 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— newMESH_NODE_STALE_MS, default 72 h, overridable viaVITE_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 theSTALE / OFFLINEvsACTIVE / ONLINEtooltip read the same picked object (MeshNodePoint.stale), so both update from this single source..env.example— documentVITE_MESH_NODE_STALE_HOURS=72.Validation
npx tsc --noEmitpasses.🤖 Generated with Claude Code
Generated by Claude Code