Commit Graph
4 Commits
Author SHA1 Message Date
efitenandClaude Opus 5.5 5da69305b8 feat: ask a repeater without a CoreScope name for its own name
Field case 2026-10-16: c0cdee59e0db981b answered every discover sweep,
but CoreScope has never seen its advert, so it stayed a bare prefix and
got no regions ask either.

- nodeNames flag (on when config.json exists and omits it, off without
  a config, like regionDiscovery). With it on, discover requests drop
  DISCOVER_PREFIX_ONLY, so replies carry the full 32-byte pubkey
  (+24 bytes each, simple_repeater/MyMesh.cpp:824).
- A repeater heard in range is looked up once per session. Only when
  CoreScope answers without a name is it asked ANON_REQ_TYPE_OWNER
  (MyMesh.cpp:165). The reply is "name\nowner_info"; owner_info is
  dropped.
- Name and regions asks share one queue and one per-encounter budget
  (src/asknext.js): the companion keeps one pending anon request
  (companion_radio/MyMesh.cpp:1570) and the repeater limiter is shared
  across request types. The name is asked first.
- The name replaces the prefix in the recent list and regions card, and
  is published on meshcore/client/{pk}/names as NODE_NAME with the
  companion's fix. New topic; /packets is unchanged.
- Debug header: a names row and nodeNames in the config row.

Not done: CoreScope does not ingest /names yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:25:48 +02:00
efitenandClaude Opus 5.5 11ca093dd9 feat(names): resolve an ambiguous path hash to its one forwarder
A 2-byte path hash that CoreScope calls ambiguous stayed a bare prefix,
even when the only other match cannot forward. Field case 2026-10-16:
e470 matched BE-HSS-HVZZWL-DIS (repeater) and Aegis (companion), so the
repeater got no name and no regions ask.

Companions and sensors do not forward by default
(companion_radio/MyMesh.cpp:486), so for keys of 4 bytes or fewer the
candidates are fetched from the new optional searchUrl
(/api/nodes/search) and narrowed to repeater/room. Exactly one left:
that is the node. A full search page (10 rows) decides nothing, because
it may have cut off a second forwarder.

Not covered: a companion with client-repeat turned on is ignored here.
Resolve and pubkey lookups now share one session cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:25:34 +02:00
efiten cbf786f2cc fix: accept node-discover responses as region-discovery candidates
Every repeater on this network has a 47h advert interval, so real
adverts are almost never heard and the region-discovery candidate map
stayed empty — selectNextTarget always returned null and no region
request was ever sent (five discover rounds, zero region requests in
the field log).

Node-discover responses are what actually arrives constantly, but they
carry only an 8-byte pubkey prefix and no advert timestamp/type. Fixes:

- meshpacket.js: parsePacket now also extracts discoverType (low
  nibble of the DISCOVER_RESP flags byte, per
  simple_repeater/MyMesh.cpp:801) alongside the existing discoverPubkey.
  Purely additive — deriveHeardKey is untouched and its pinned tests
  stay green unmodified.
- names.js: add resolvePubkey, a sibling of resolveName that resolves
  a prefix to the full 32-byte pubkey via the same endpoint and cache
  discipline (network errors never cached; a full 64-hex key needs no
  request).
- app.js: accept hk.src === 'discover' candidates when discoverType is
  ADV_TYPE_REPEATER, resolved to the full pubkey so a repeater never
  keys twice under prefix and pubkey. advertTs is stored null;
  selectNextTarget's existing due() rule already asks it once per
  session and re-asks automatically once a real advert arrives.
- app.js: maybeQueryRegions now logs the half-rate rounds where a
  region request was due but no candidate existed yet — this bug was
  previously silent.
2026-08-18 20:27:33 +02:00
efiten a7d451a3ff feat(names): resolve URL from runtime config; skip when unset 2026-06-13 21:12:28 +02:00