[Feature] Mesh: push live peer events to contacts UI for instant updates (drop 5s poll) #48
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The mesh contacts/peer list in the UI updates on a 5-second poll (
mesh.fetchPeers), even though the backend already emits real-time peer events. Wire the UI to those events so newly-discovered contacts appear instantly on push instead of waiting for the next poll tick.Current behavior
MeshEvent::PeerDiscovered(new) /MeshEvent::PeerUpdated(existing) the moment an advert frame is decoded —core/archipelago/src/mesh/listener/decode.rs:454-459.refresh_contacts()also merges the firmware contact table on connect, onshould_actionframes, and every 60s —core/archipelago/src/mesh/listener/session.rs:428,466-468,494.neode-ui/src/views/Mesh.vue:328-334ignores the event stream for the peer list and just pollsmesh.peersevery 5s via the store'sfetchPeers()(neode-ui/src/stores/mesh.ts:168).Net effect: data is fresh on the node within seconds, but the UI lags up to 5s and generates constant poll traffic.
Proposed change
Mesh.vueto the existing mesh event stream and applyPeerDiscovered/PeerUpdated(andIdentityReceived) topeers.valueincrementally.MeshEvent; if not, add one (events are already broadcast onstate.event_tx).Acceptance
Found while debugging a meshcore "stuck connecting" report (root cause there was unrelated: no radio attached / cable). Related: #42.
Implemented: mesh peers now appear on push instead of the 5s poll. Backend (
server.rs) subscribes to meshevent_txand, onPeerDiscovered/PeerUpdated(debounced ~2Hz), nudges the data-model revision so/ws/dbclients refresh. Frontend (Mesh.vue) subscribes to the WS and refetches peers on push; the 5s poll stays only as a backstop for offline detection (no PeerLost event). Bothcargo checkandvue-tscgreen. Verify on a node with a radio (e.g. .116).