Commit Graph
180 Commits
Author SHA1 Message Date
efitenandClaude Opus 5.5 717e1ebabe docs(user-guide): account, results, firmware, keep the app in front
- CoreScope account: login, device token, linking by signature, held
  queue for unlinked companions, with a demo screenshot
- Seeing your results: Nodes > Reach > coverage in CoreScope
- Firmware table: FIRMWARE_VER_CODE gates in src/ mapped to the first
  companion release tag that carries them (meshcore-firmware git history)
- Keep the app in front: a backgrounded page stalls GPS and receptions get
  the last reported position (currentFix has no age check)
- The 2-byte path-hash switch on connect, which changes a radio setting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:42:44 +01:00
efiten 171529679f Merge pull request #22 from efiten/docs/user-guide-screenshots
docs(user-guide): screenshots of Home, Map and Settings
2026-11-09 21:29:07 +01:00
efitenandClaude Opus 5.5 b2de9a70f0 docs(user-guide): screenshots of Home, Map and Settings
Made from the local dev server with demo data injected into the DOM and a
demo route drawn through src/localmap.js; no real drive, node or companion.
Also documents the RF log counter, the declared-scopes card and the map
colours, which the screenshots show and the text did not mention.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:28:39 +01:00
efiten fbea1f84d3 Merge remote-tracking branch 'origin/master' 2026-11-09 21:20:03 +01:00
efiten 9a268186b0 Merge pull request #21 from efiten/docs/user-guide
docs: user guide for people driving with the app
2026-11-09 21:19:56 +01:00
efitenandClaude Opus 5.5 ada73093a0 docs: user guide for people driving with the app
The README is written for sysops hosting the app. Users asked whether it is a
mapper, whether they can still chat, and whether there is a wiki. The guide
answers those: what is recorded, what the app transmits (discover, region
asks, uplink ping), the one-BLE-connection limit, the screens, the
stationary pause, and a short troubleshooting table. README links to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:16:58 +01:00
efiten d8da4f6144 Merge remote-tracking branch 'origin/master' 2026-10-23 09:27:21 +02:00
efiten ff438ba744 Merge pull request #20 from efiten/fix/verify-adverts-config
v1.22.1: verifyAdverts, backlog of another companion, README ACL
v1.22.1
2026-10-23 09:20:30 +02:00
efitenandClaude Opus 5.5 d6eee50137 release: v1.22.1, verifyAdverts and the backlog of another companion
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEgJ9U9V5WmHyRjL96MaDz
2026-10-23 09:20:07 +02:00
efitenandClaude Opus 5.5 cfce8fc7eb docs(readme): ACL allows meshcore/client/${clientid}/#
The README listed /packets, /rf and /regions only. The app also
publishes /names (nodeNames) and /uplink (uplinkPing). The section now
recommends the /# rule and lists all five subtopics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEgJ9U9V5WmHyRjL96MaDz
2026-10-23 09:19:50 +02:00
efitenandClaude Opus 5.5 a7a72d7eb7 fix(drain): keep another companion's backlog until it is connected
drainOnce published a row stamped with an earlier companion under that
companion's pubkey while the MQTT clientId was the companion connected
now. The documented ACL binds the topic to ${clientid}, so the broker
denies that publish, and with EMQX's default deny_action=ignore it still
sends a PUBACK. The row was removed from the queue and never stored.

Such rows now stay in the queue (counted as `waiting`) and go out once
their own companion is connected. The hold is asked for the connected
companion only. The debug log says once how many rows are waiting.

Tests: 430 pass (sandboxed run of the full suite). Not tested against a
live broker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEgJ9U9V5WmHyRjL96MaDz
2026-10-23 09:19:50 +02:00
efitenandClaude Opus 5.5 2c1905f077 fix(config): keep verifyAdverts through normalizeConfig
normalizeConfig (src/config.js) copied every feature flag except
verifyAdverts. processFrame reads the flag from the normalized config
(src/app.js:1333), so verifyAdverts:true in config.json never reached
heardKeyAfterVerify and 0-hop adverts with an invalid signature were
still accepted under their claimed pubkey.

The existing test only called featureEnabled on hand-built objects.
The new test goes through normalizeConfig: true when set, false when
absent or false.

Tests: node --test, 429/429 pass (run in the WSL sandbox with the
installed node_modules of 4a91f20; the worktree has no node_modules).
Not done: version bump and docs/releases entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEgJ9U9V5WmHyRjL96MaDz
2026-10-23 00:26:21 +02:00
efiten 4a91f2074a Merge pull request #19 from efiten/feat/auto-scope
feat: automatic uplink ping scope (v1.22.0)
v1.22.0
2026-10-16 21:36:00 +02:00
efitenandClaude Opus 5.5 52c95526a5 feat: choose the uplink ping scope from the repeaters around the companion (v1.22.0)
A fixed uplinkScope ("be") reaches almost nobody just over the border: of
the Limburg border repeaters in CoreScope's node_declared_regions, many in NL
declare only *, nl or nl-li. uplinkScope is now a preference list
("de,nl,be"). Per ping, src/autoscope.js counts how many of the repeaters
heard directly in the last 5 minutes forward each candidate (the companion's
default scope first, then the list) and takes the most forwarded. With none
forwarded but *, the ping goes out un-scoped (fw v12+); with nothing known,
in the companion's default scope (CMD_GET_DEFAULT_FLOOD_SCOPE, fw v10+).

Declared regions come from CoreScope GET /api/nodes/declared-regions
(uplinkRegionsUrl, default corescopeUrl + that path, every 30 min) merged
with this session's own region answers. The MQTT payload is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 21:28:16 +02:00
efiten e206ccdb10 Merge pull request #18 from efiten/feat/uplink-ping
v1.21.0: uplink ping (does the mesh hear the companion)
v1.21.0
2026-10-16 16:14:54 +02:00
efitenandClaude Opus 5.5 9b1ff057ed feat: "Uplink ping now" button to test a spot
Sends one uplink ping immediately from Settings → Diagnostics, shown once
the ping channel is set up. It skips the interval, distance, parked and
skip-cell rules (the skip cells live on the phone, so a spot already
pinged could not be retested for 7 days); the hourly cap and a GPS fix are
still required.

Field test on rx.on8ar.eu/beta, 2026-10-16: ping cdrx 78277c0e was echoed by
1403 and c0cd directly and via 1403→e470 and 1403→…→0606. The echo hash
b76c6a2777f9b0e9 matches the transmission CoreScope received from 15
observers (TRANSPORT_FLOOD, scope be, first hop 1403). Release notes updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:14:23 +02:00
efitenandClaude Opus 5.5 9a60ca0db4 release: v1.21.0, uplink ping
Release notes in docs/releases/v1.21.0.md. Service-worker cache bumped to
coredrive-rx-v56.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:52:03 +02:00
efitenandClaude Opus 5.5 70a59c6197 feat: uplink ping, test whether the mesh hears the companion
CoreDrive only measured what the companion hears. With uplinkPing on (off by
default), it sends a short message on a dedicated hashtag channel
(#coredrive) carrying only a random tag, listens 10 s for a repeater
re-broadcasting it, and publishes the result on the new topic
meshcore/client/{pk}/uplink (UPLINK_PING): tag, packet hash of the echo,
every echo with its first and last hop, and the GPS fix. The position never
goes over the mesh.

- src/grptxt.js: hashtag channel key, channel hash, GRP_TXT MAC check and
  AES-128-ECB decrypt, and the packet hash, per the firmware
  (Mesh.cpp:540-557, Utils.cpp:127-145, Packet.cpp:41-50). Checked against a
  real #wardriving packet from CoreScope live: same text and same hash
  (12c82f82df4cc29c). AES-ECB comes from @noble/ciphers 2.0.1, as WebCrypto
  has no ECB.
- src/uplinkping.js: channel message, get/set channel and flood-scope frames
  (companion_radio/MyMesh.cpp), slot choice that never overwrites another
  channel, echo matching on the tag.
- src/uplinksched.js: a ping only with a fix of 100 m or better, after
  uplinkIntervalSec (60) and uplinkMinMoveM (250), under uplinkMaxPerHour (50),
  and not in a ~180 m cell pinged in the last uplinkSkipDays (7).
- uplinkScope (e.g. "be") sends the ping as a region-scoped flood via
  CMD_SET_FLOOD_SCOPE (fw v8+) and resets the override right after.
- app.js holds the radio (acquireRadio) for the whole exchange, as OK/ERR
  replies carry no correlator; it skips while parked, signing or asking.
- DEVICE_INFO now yields the channel slot count; log header gets a ping row.

Tests: 417 pass (+20): crypto against the real packet, frames, slot choice,
echo matching, scheduler, config defaults, payload shape, header row. Not
tested on air: no ping has been sent from a real companion yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:52:02 +02:00
efiten a8f150ebf2 Merge pull request #17 from efiten/feat/node-names
v1.20.0: repeater names from the repeater itself
v1.20.0
2026-10-16 10:57:27 +02:00
efitenandClaude Opus 5.5 8b5a89923f release: v1.20.0, repeater names from the repeater itself
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:26:20 +02:00
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 af6004f527 Merge pull request #16 from efiten/feat/corescope-login
feat: CoreScope login and companion linking (v1.19.0)
v1.19.0
2026-10-09 15:51:58 +02:00
efitenandClaude Opus 5.5 5a4319736e fix(account): a linked companion no longer goes to My nodes
CoreScope stopped adding linked companions to My nodes (a companion is
not a node to monitor), and its link answer has no myNodes field any
more. The card and the log no longer mention My nodes, and an answer
from an earlier server build that still carries the field is ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:39:53 +02:00
efitenandClaude Opus 5.5 1c723513ff docs(release): v1.19.0 test count
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:41:36 +02:00
efitenandClaude Opus 5.5 ea69769d5f fix(account): show the login only when CoreScope announces companion linking
A CoreScope with accounts but without companion linking (v3.14) sends
userManagement.enabled and answers POST /api/auth/device-token with its
SPA page, so the card appeared and every login failed with 'HTTP 200'.
Discovery now also needs userManagement.companionLinking; without it
the card stays hidden and uploading is as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:41:28 +02:00
efitenandClaude Opus 5.5 270b63dc0b release: v1.19.0, CoreScope login and companion linking
Minor: the MQTT payload contract is unchanged. SW cache v54. Optional
corescopeUrl. Release notes in docs/releases/v1.19.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:12:27 +02:00
efitenandClaude Opus 5.5 b1d43baf2d fix(account): retry a missing discovery and a waiting link with backoff
A CoreScope that was briefly unreachable at start, a slow mobile
request or a 429 left the link waiting, and only an 'online' event or a
reconnect asked again; navigator.onLine rarely changes, so a held queue
could stay held for the whole session. Both are now asked again after
30 s, 60 s, 2, 5 and then every 10 minutes, and stop on an answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:11:47 +02:00
efitenandClaude Opus 5.5 0883f43b22 fix(account): a link attempt belongs to one companion; a BLE drop mid-sign is transient
An attempt for the previous companion could run into the next
connection and have the new companion sign its challenge (a 400 that
marked it failed), while the new companion got no attempt of its own.
Attempts are now per companion: one for another companion waits and
then runs, and signing checks that the target is still connected.

A BLE drop during signing followed by the transport's fast reconnect
let the 4 s step timeout read as 'firmware cannot sign' or a definite
failure, which blocked the link for the connection. A sign error after
the link changed, or with it down, is now transient and retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:10:45 +02:00
efitenandClaude Opus 5.5 0c942e483e fix(drain): publish every queued row under the companion that captured it
With the hold, a queue can keep one companion's rows for a long time.
Connecting another, linked companion then published that backlog under
the new pubkey: someone else's receptions counted as its coverage, and
data from an unlinked companion got past requireLinkedCompanion. Rows
now carry the capturing companion (rx, rx_name; not part of any MQTT
payload), drain publishes each under its own pubkey, and the hold is
decided per row. Rows queued before this version behave as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:09:40 +02:00
efitenandClaude Opus 5.5 62621c591c feat: CoreScope account card, auto-link on connect, hold while unlinked
Settings gets a 'CoreScope account' card, shown only when CoreScope has
user management on (or this companion's uploads are held). A connected
companion is linked automatically; the sign exchange holds the radio so
region discovery, the discover sweep and the RF sampler cannot answer
for it. Drain holds only when CoreScope requires linked companions.
The service worker no longer caches CoreScope's account/config answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:03:04 +02:00
efitenandClaude Opus 5.5 298a67681f test: MQTT payload is identical with and without login; hold end to end
Drives the real Publisher payload builders through drainOnce with a
logged-out and a logged-in account and compares the bytes, and pins the
hold rules: flag off never waits, flag on holds an unlinked companion
without touching the queue, linking releases it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:00:25 +02:00
efitenandClaude Opus 5.5 40c294dba4 feat(drain): hold the queue while CoreScope requires a linked companion
One optional precondition next to publisher.connected(): when held, the
pass publishes nothing and does not touch the queue. Push pending now
names the hold instead of blaming the broker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:00:02 +02:00
efitenandClaude Opus 5.5 46f27bc618 feat: account card view model (pure)
Linked / linking / waiting / firmware cannot sign / failed + Retry, the
● on the connected companion, and the 'N waiting' line while held. The
card also shows while held after a failed discovery, so a held queue is
never unexplained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:59:41 +02:00
efitenandClaude Opus 5.5 9f9ed11e63 feat(account): hold a freshly linked companion until the ingestor can see it
With requireLinkedCompanion, CoreScope's ingestor re-reads its linked
list on a miss at most once per 5 s and drops what arrives in between,
after the broker acked it. A fresh link now keeps the queue held for
6 s and then signals a change, so the first upload is not lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:59:29 +02:00
efitenandClaude Opus 5.5 9c22d19453 feat(account): auto-link a connected companion to the account
Cached → done; refreshed list → done; else challenge, sign
'corescope-link:<host>:<challenge>' on the companion, post, cache.
410 retried once, 400 and unsupported firmware not retried until the
next connect or Retry, network, 429 and BLE drops wait for the next
attempt. myNodes full/failed is a note, not a failure. One attempt at
a time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:58:04 +02:00
efitenandClaude Opus 5.5 039a6747e6 feat(account): device-token login, logout, companions cache, 401
The password is sent once and never stored; the token is stored with its
origin and never logged. Logout revokes without waiting. Any 401 clears
the token. 429 says how long to wait when Retry-After is readable. No
request carries cookies: CoreScope judges a request with its session
cookie on that cookie alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:57:36 +02:00
efitenandClaude Opus 5.5 9ee9984b01 feat(account): discovery gate, origin-bound session, hold flag
Only userManagement.enabled === true turns the feature on; every other
outcome is off with one log line naming the reason (including the CORS
hint). clientRxRequireLinkedCompanion is remembered per origin; a
deployment that never answered means not required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:57:02 +02:00
efitenandClaude Opus 5.5 304553f98b feat: companion signs bytes over CMD_SIGN_START/DATA/FINISH
Same onFrame/send path as selfinfo.js. 128-byte chunks stay under the
176-byte frame and the ESP32's 173-byte ATT payload. ERR or silence on
START means the firmware cannot sign; OK/ERR ahead of the START reply
belong to earlier commands and are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:53:24 +02:00
efitenandClaude Opus 5.5 cea751fa7c feat(config): optional corescopeUrl, normalized to an origin
Falls back to the origin of resolveUrl; both empty turns the account
feature off. Runtime config only, nothing hardcoded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:52:35 +02:00
efitenandClaude Opus 5 39d2e7edfb docs(433mhz): CoreScope step 1 is in production
Band pill live as v3.11.0-on8ar.6: 42 observers, 40 badged, 1 on 433. The two
without a badge are the kiekr-android clients, which publish no radio config
and so get no badge rather than a default band — the behaviour this document
asks for on the mobile side too.

Nothing implemented in this repo, and nothing decided about whether it should
be.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YAR8fdNTzqjtsggq4xCX6
2026-09-23 11:39:19 +02:00
efitenandClaude Opus 5.5 8f8cb204ac docs(433): the 4.4% band gap is kiekr-android, not coredrive-rx
kiekr-android publishes on the observer path and is counted in
observations. coredrive-rx publishes only on meshcore/client/{pk}/...,
which the ingestor routes to the client tables before the observer path,
so adding radio here cannot close that gap. Corrected the section,
the open questions and the status table.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 11:19:31 +02:00
efitenandClaude Opus 5 bd1817f0a9 docs: what CoreScope is doing about 433 MHz, and what this repo would need
Living document so this side can plan against the CoreScope work rather than
guess at it. The CoreScope side keeps the Status table current.

The finding that matters: no firmware change and no new BLE command are needed.
The companion already reports its frequency in the SELF_INFO frame this app
parses at connect, at byte 48 as uint32 LE in MHz * 1000. The layout is read out
of examples/companion_radio/MyMesh.cpp at firmware 0679dbef, and cross-checks
against src/selfinfo.js, which already reads pubkey at 4..36 and name from 58.

STATS_RADIO is the wrong route: it carries noise_floor, last_rssi, last_snr and
the air-time counters, and no frequency.

Also records why this repo is the remaining gap at all: on the reference
deployment 40 of 42 active observers publish their radio config, and the two
that do not are kiekr-android clients, together 4.4% of observations.

And the caveat worth deciding before any code: CoreScope stores the band as
current device state, so retuning rewrites history. Harmless for a fixed
observer, wrong for a mobile one that can change band between sessions. If this
is built, the band belongs with the reception or the session.

Nothing implemented here. No decision taken on whether it should be.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YAR8fdNTzqjtsggq4xCX6
2026-09-23 11:05:26 +02:00
efiten 9b053d6537 Merge pull request #15 from efiten/fix/push-reconnect-orphans
fix: "Push pending now" during a slow connect left orphaned MQTT sockets (v1.18.4)
v1.18.4
2026-09-19 19:54:49 +02:00
efitenandClaude Opus 5 0e72292253 fix: "Push pending now" during a slow connect left orphaned MQTT sockets (v1.18.4)
Publisher.reconnect() called mqtt.js client.reconnect() unconditionally.
mqtt.js connect() replaces this.stream without closing the previous one
(client.js:257), so a press while a CONNECT was still unanswered left the
earlier socket open. When an orphan closed, its 'close' set
client.connected = false over a live session and armed a reconnect that
orphaned that session in turn.

Field log 2026-09-19: connack timeouts on a weak mobile link, then five
presses in four seconds (12:05:54 to 12:05:57), then "connected" followed
by "offline" and "connection closed" in the same second at 12:05:58,
12:06:00, 12:06:02 and 12:06:04.

reconnect() now returns false and does nothing while an attempt is in
flight (no session, no reconnect timer armed); the Push button logs that.
Once the socket has closed it still skips the 4 s wait. Two tests run the
real mqtt.js client over a fake stream; without the guard the first fails.

Not verified: the EMQX log has no lines for this client id, so the
broker-side session takeover between the sockets was not observed.

Version, release notes and the service-worker cache bump ride along, as
AGENTS.md requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 19:54:05 +02:00
efiten 9292d28a81 Merge pull request #14 from efiten/fix/region-hold-timers
fix: the region hold's default timers threw in the browser (v1.18.3)
v1.18.3
2026-09-18 10:57:46 +02:00
efitenandClaude Opus 5 1a98a6df8d fix: the region hold's default timers threw in the browser (v1.18.3)
holdUntilReply's default was `timers = { setTimeout, clearTimeout }`, so the
native timers were called with that object literal as `this`. Chromium rejects
that with "TypeError: Illegal invocation"; Node does not check, which is why
279 tests passed over it.

The throw lands inside askRepeater's try, after the ask has gone out, so the
20 s hold and the restore of the repeater's original contact path were both
skipped; the restore record waited in localStorage for the next connect. It
fires once per repeater per session, on the ask that applies the override.
Field log 2026-09-18: three of them, 14036f, e3d3f4 and cf7903, each on
"attempt 1 of 4".

Version, release notes and the service-worker cache bump ride along, as
AGENTS.md requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 10:57:17 +02:00
efitenandClaude Opus 5 ac9f5126be fix: end the contact-override hold when the repeater answers
A repeater saved as a contact has its stored path forced to zero-hop for the ask and put
back afterwards, and the queue waits for that round. It waited a flat 20s. In the
2026-09-14 commute log 49a98584fce5 and 72d171e63056 both answered 2s after the ask and
the queue then sat blocked 18s more each; cafe314d00e2, heard at 17:47:01, was not asked
until 17:47:14 because of it. Every answer visible across the field logs so far — 11 of
them — arrived 1–2s after its ask.

holdUntilReply resolves on whichever comes first: the matched reply for that target, or
OVERRIDE_HOLD_MS. onRegionsFrame releases the hold right after it files an answer, and a
reply that lands before the hold starts skips it. The no-reply fallback keeps its 20s:
how early a restore is safe while no answer has arrived is a firmware question, and this
only removes time after the answer is in hand.

The restore line now says which way the hold ended, "(reply in, hold ended early)" or
"(no reply in 20s)", so the next field log can confirm it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GJuEuyG3JMrSeAGCmJ1GP
v1.18.2
2026-09-14 18:09:15 +02:00
efitenandClaude Opus 5 7c4df3afbf release: v1.18.1
ec55d31 fixed the inverted guard in noteLinkState but changed app.js without bumping
the version or the service-worker cache, so a field log from a phone running the fix
would still have read "v1.18.0" and could not have shown whether the fix was in.
Version, cache name and release notes go together.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GJuEuyG3JMrSeAGCmJ1GP
v1.18.1
2026-09-14 10:20:34 +02:00
Erwin FitenandClaude Opus 5 ec55d31bfe fix: the debug log announced a healthy BLE link once a second
noteLinkState's guard was inverted. `state.linkQuiet` holds the INVERSE of
the link being up, so the steady state is `linkQuiet !== linkUp` and an edge
is `linkQuiet === linkUp`. The guard returned on the edge and fell through in
the steady state — the exact opposite of both.

Per-second monitorTick therefore wrote "companion link back" on every tick of
a perfectly healthy link, and swallowed the real transition: linkQuiet never
flipped off its `false` initial value, so "companion link down" could never be
reached at all. A field log from this morning shows 157 of 200 buffered lines
spent on the spam, the whole 200-line ring buffer covering 2m36s, and not one
"link down" line — defeating cc710a3, which added the pair so that a dropped
link would stop reading like an app that had crashed.

The edge decision moves to monitor.js as the pure `linkTransition`, next to
the other per-tick monitor helpers, since app.js cannot be imported under
node --test. Five regression tests cover both steady states, both edges, and a
full drop/return cycle driven tick by tick.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 09:48:06 +02:00