Repository navigation
Description
Problem
With 1-byte path hashes (the firmware default), several repeaters share each hop code, so the hop resolver has to guess which node a 1-byte hop is. When it guesses wrong, the Live map draws a link that never existed. Recently a Danish repeater looked as if it was talking to Oslo. Its key starts with 18, and so do the keys of three other repeaters and rooms, one of them in Norway. The stored packets are correct; only the drawing is a guess.
What exists today does not let an operator stop this on the Live map:
- The Show / Mark / Hide setting for 1-byte hops (customizer,
public/hop-filter.js, 1-byte hops: Show / Mark / Hide modes, with Mark as default #674/feat(hops): Show / Mark / Hide for 1-byte path hops, Mark by default (#674) #677) applies to the route view, the Live feed list and the node path panel. It does not apply to the Live map animation:resolveHopPositions()andanimatePath()inpublic/live.jsnever consult it. - The setting is per browser only. It lives in
localStorage(meshcore-1byte-hops-mode, defaultmark), and an operator cannot choose the default for their visitors. - The Live "Multibyte only" toggle hides every packet with a 1-byte path. It works, but it is also per browser only.
maxHopDistin config does nothing.roles.jscopies it towindow.MAX_HOP_DIST, buthop-resolver.jsuses its own localconst MAX_HOP_DIST = 1.8for the "impossibly far" sanity check, so the configured value is never read.
Scale: in a sample of 3,000 recent packets on a production instance, 1,518 have a path with hops. Of those, 233 (15 %) use 1-byte hops and 1,285 use 2- or 3-byte hops. Hiding the uncertain hops costs the Live map little.
Plan
Nothing stored changes: no packets, observations or resolved paths are deleted or rewritten. All of this is render-time.
M1: the Live map follows the 1-byte hop setting
Changes:
- Before the hops are resolved for the animation, the Live map applies the current mode, using the same rules as the rest of the app (
MC_get1ByteHopsMode,MC_isVisibleHop/MC_filterPathHopsfromhop-filter.js):- Show: unchanged.
- Hide: 1-byte hops are left out of the animated path. When hops were dropped, the remaining segments are drawn dashed and lighter, like
route-render.jsalready does (feat(#1633): customizer toggle to hide 1-byte path hops everywhere Kpa-clawbot/CoreScope#1689 r1). Otherwise a shortened path reads as a direct link. - Mark: 1-byte hops stay. Segments that start or end at a 1-byte hop are drawn dashed and lighter, so a guessed link looks different from a certain one.
- New packets follow a mode change at once (
mc-hide-1byte-hops-changed). Animations already in flight just finish. - "Multibyte only" stays as it is.
Performance: the filter is O(hops) per packet on a path that is already O(hops), with no new lookups, so there is no measurable change in the WebSocket hot path. A benchmark test will prove it: the filter plus resolveHopPositions on 10k synthetic packets with and without the filter.
Tests:
- Unit tests, using a
vmcontext liketest-frontend-helpers.js, for each mode:- which hops reach the animation;
- which segments are marked dashed and lighter;
- that Hide with no 1-byte hops in the path changes nothing.
- A Playwright test:
- set the mode to Hide and inject a WS packet whose path has a 1-byte hop;
- assert that no Live polyline vertex sits on that hop's node;
- in Mark mode, assert that the segment carries the dashed class.
Browser validation:
- On staging, the Live page in all three modes, at desktop width and on a phone (375 px wide), from a cold start.
- A screenshot of a guessed link in Show, the same link in Mark, and the same link gone in Hide.
M2: the operator chooses the default mode
Changes:
- A new config key,
customizer.oneByteHopsDefault, taking"show","mark"or"hide".- It is a named field on
CustomizerConfig, with nomap[string]interface{}. - It is validated: an unknown value logs a warning and falls back to
mark. - If the key is absent, the behaviour is as today (
mark).
- It is a named field on
- The value is sent in the existing
customizerblock of/api/config/client. hop-filter.jsresolves the mode in this order: the visitor's stored choice, then the operator default, thenmark.- Storage change: today a choice equal to the default is stored as "no key". With a server-side default that breaks: a visitor who picks
markon a server whose default ishidewould fall back tohide. So an explicit choice is always stored.- The existing migration from the old boolean key stays.
- A visitor who never chose anything has no key and follows the operator default, including later changes to it.
- The customizer shows which mode is the server default.
Tests:
- Go:
- config parsing and validation: valid values, an unknown value, an absent key;
- the shape of
/api/config/client.
- JS:
- the resolution order;
- that an explicit
marksurvives ahidedefault; - the legacy migration.
Browser validation:
- With the default set to
hideon staging, a fresh browser profile shows Hide on Live. - After choosing Show in the customizer, Show persists across reloads.
M3: maxHopDist takes effect
Changes:
hop-resolver.jsreads the effective limit, the configuredwindow.MAX_HOP_DIST, falling back to 1.8, instead of its private constant. The unit stays degrees, as documented inroles.js, so existing configs keep their meaning.config.example.jsondocuments the key.
Tests:
- A hop-resolver unit test:
- with a lowered limit, a hop about 150 km from both neighbours is marked
unreliableand not drawn; - with the default, it is kept.
- with a lowered limit, a hop about 150 km from both neighbours is marked
- A regression test that the default stays 1.8 when the key is absent.
Browser validation:
- On staging, set a low
maxHopDistand confirm on Live and in the route view that a long guessed hop disappears.
Config and customizer implications
- New:
customizer.oneByteHopsDefault(M2). It is already reflected in the customizer, which shows the server default. - Now effective:
maxHopDist(M3).- A later milestone could expose it in the customizer.
- Renaming it to a kilometre-based key is a separate decision.
- No new npm dependencies and no build step.
Open questions for the owner
- What Hide means on the Live map: all 1-byte hops, consistent with the route view and feed today, or only ambiguous ones (a code shared by more than one known repeater or room)?
- Proposal: all 1-byte hops, consistent with the rest of the app.
- Ambiguity-aware hiding would be a separate follow-up, because it changes the meaning of the setting everywhere.
- The default for our instance after M2:
hideormark? - The unit of
maxHopDist: keep degrees, or add a km-based key and deprecate the old one?
Activity
dborup commentedon Nov 18, 2026
Parked (owner decision, 2026-11-18)
The owner wants to keep all live traffic visible on the Live map, so Hide on Live and M2 (an operator default) are not wanted for now. A smaller variant, "Mark only on Live", was measured before any code was written. It would change almost nothing, so this issue is parked. No code was written.
Measurement
I sampled the production Live WebSocket for 25 s:
resolved_pathentryresolveHopPositions()inpublic/live.jstakes every hop from the server (HopResolver.serverHopEntry). The client heuristic, and with it theambiguousflag, is never used on Live.cmd/ingestor/resolved_path.go,path_resolver.go) only fills a position when exactly one candidate remains: a unique prefix, or exactly one candidate adjacent to the previous hop in the neighbour graph.HopDisplay.isUnsureInferredHop).Consequence for the variants
resolved_path, so the Live map can mark the weaker neighbour-graph answers. That is a larger piece of work and is not planned.Context
There was a report that a Danish repeater was talking to Oslo. It was not supported by our data: the Oslo nodes had not been heard for two days, and the repeater's paths ran to Funen and Jutland. So there is no concrete misdrawing to fix right now.
Still valid from the plan
M3, a working
maxHopDist(roles.jssetswindow.MAX_HOP_DIST, buthop-resolver.jsreads its own constant), is a small standalone fix that can be done on its own if wanted.dborup commentedon Nov 20, 2026
Owner decision 2026-11-20: M3 only (a working
maxHopDist) goes ahead as a standalone fix. M1 and M2 stay parked.fix(config): correct maxHopDist docs, drop unreachable branch (#912 M3)
Merge pull request #946 from dborup/fix/912-max-hop-dist
dborup commentedon Nov 20, 2026
M3 is merged: #946 (a633ad8). The configured
maxHopDistnow takes effect in the browser's hop guessing, and the server validates it (>0 to 10 degrees, else one warning and the default 1.8). M1 and M2 (Live Hide/Mark, operator default) stay parked, so this issue stays open.dborup commentedon Nov 28, 2026
Owner decision (2026-11-27): M1 and M2 are restarted. Until M2 (#1001, the operator default) is merged, the Live map defaults to Show for the 1-byte hop setting: a visitor who has not chosen a mode sees Live as before. An explicit choice in the customizer (Show / Mark / Hide) applies at once. Once M2 lands, the operator default decides the starting mode.
Relates to #1004 (M1) and #1001 (M2).
fix(live): #912 M1 fix round — Live defaults to Show until M2; fallba…
fix(customizer): a way back to the operator's 1-byte hop default (#912 …
Merge pull request #1004 from dborup/feat/912-m1-live-1byte-hops
Merge origin/master into feat/912-m2-1byte-operator-default
fix(live): the Live map starts from the operator's 1-byte hop default (…
fix(config): serve the 1-byte hop default only when configured (#912 M2)
Merge pull request #1001 from dborup/feat/912-m2-1byte-operator-default
dborup commentedon Nov 29, 2026
Fixed by #1004 (M1: the Live map follows the 1-byte hop setting), #1001 (M2: an operator default for the 1-byte hop mode; an unconfigured instance behaves as before) and #946 (M3: a working maxHopDist). All milestones are merged.