From the Gemini adversarial review of Epics A and C, each checked before
fixing:
- TCP framing now matches ArduinoSerialInterface::checkRecvFrame: a zero
length is skipped, and a frame over MAX_FRAME_SIZE (176) is read to its
end and cut. New raw-socket tests; both fail on the old code.
- Remote preset tests waited for the fake to hold a login session; they
now wait for the client to receive LOGIN_SUCCESS for that node.
- The release guard folds case and backslashes before matching, so
'../../Test/' and '..\..\test\' are caught too.
- The runner listens on 127.0.0.1 unless given --host, and a bad seed
file exits 65 with a one-line message instead of a stack trace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the Gemini adversarial review of Epic A, both checked against the
firmware before fixing:
- The generator reads source with regexes, so a protocol code inside #if
would be taken whichever branch a build uses. It now refuses one (none
exist at the pinned tags; FIRMWARE_VERSION's #ifndef default is not a
protocol code), and refuses a name defined twice with different values.
- The contract test compares names after dropping case and underscores;
it now fails if two names collapse to the same key.
Both pinned manifests regenerate unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in Epic C verification (#782): a parallel test run failed "stock
over TCP" because SET_DEVICE_TIME hadn't reached the fake yet;
connectTcp's closing syncTime() only queues the frame on the socket.
The test now waits for every handshake command to arrive. Fixed here,
where the test was added, and merged forward through Epics B and C.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in Epic C verification: one parallel run of test/fake_radio
failed "stock over TCP" because SET_DEVICE_TIME hadn't reached the fake
yet. connectTcp's closing syncTime() only queues the frame on the
socket, so it can land just after the channel and contact data the
test waited for. The test now waits for every handshake command to
arrive. 5 consecutive full fake-radio runs clean (136 tests each).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Running the capture script against the fake runner showed the 0xC1,
0xC2 and 0xC6 replies missing: split() filed every code >= 0x80 as a
push, but Offband replies use 0xC0-0xCF. Pushes are 0x80-0xBF now.
--tcp host:port runs the same capture over TCP (the fake runner, or a
radio with a TCP companion); pyserial is only needed for --port. A new
test runs the real script against the runner and replays the capture
into a fake seeded from it: every step has its replies, the block list
and contacts come through, and the replay is exact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scans every Dart file under lib/ for import, export or part directives
that reach the fake radio, test/ or tool/, and fails on any. A second
test proves the scan catches each route (relative test/tool paths,
package paths naming fake_radio, export and part) and leaves ordinary
imports alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dart run tool/fake_radio.dart --profile offband|stock --port 5000
[--seed file] serves the fake on TCP so the desktop app can connect
with no hardware. Its clock follows real time, so ACKs and remote
replies arrive. Console: dm, chan, drop, status, quit. --seed takes an
offband-fake-radio-seed file (contacts with types and routes, channels
with secrets, remote nodes with passwords and firmware flavor) or a
captured trace. Format and the capture/manifest tools documented in
tool/fake_radio/README.md.
The TCP server moves to its own pure-Dart file (fake_radio_tcp.dart)
so dart run can load it; fake_radio_adapters re-exports it. Tests: the
README's example seed parses (docs can't drift), bad seeds are refused,
a trace works as a seed, the real connector connects and a console dm
lands, and the actual dart run process serves a client and quits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FakeRadioAppServices wires the app's services and providers as
main.dart does (minus map tiles, background service, notifications and
file logging, which no screen under test needs). The real ChatScreen
and ChannelChatScreen run attached in-process to the fake:
- a DM typed and sent reaches the radio, shows in the conversation, and
shows acked (MessageStatusIcon.isAcked) once the ACK lands
- a channel message reaches the radio on its slot and shows
Two things learned and encoded: the retry service and screens schedule
on the widget test's fake clock while the database answers in real
time, so waits move both; and without tracing the bubble marks a
message acked only when it was delivered over a known path, so the test
contact has a learned route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app's real MeshCoreConnector, MessageRetryService and
RepeaterCommandService, in-process against the fake, under the Offband
and stock profiles:
- connect: identity, channels, and the firmware the client concludes
(Offband caps present; on stock none, and no Offband command sent)
- DM sent then delivered on the ACK; a lost ACK retried then delivered
- channel send reaches the radio
- Companion preset (#647): radio params, TX power, path hash mode, as
settings_screen applies them, reported back through SELF_INFO and
DEVICE_INFO
- remote preset on a repeater, room server and sensor, built and
ordered as repeater_settings_screen does: saved (reboot to apply) and
temporary (tempradio last, path hash held back #735, applies 2 s
later); a refused value comes back as the firmware error, a good save
carries none (#748)
Test harness notes: replies reach the command service through the
receivedFrames listener the settings screen uses, and in-memory
databases stay open until the file ends because the connector's
startup reload isn't awaited. 126 fake-radio tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B1-B5 driven by the client's own frame builders under the Offband and
stock companion profiles: DM/ACK, channel send, incoming messages,
radio settings, remote login and CLI, scripted faults, and an exact
trace round trip.
Epic verification: em-dash OK, analyze clean, format clean, full suite
1185 passing (98 fake-radio tests after the prefix fix), Windows and
APK release builds OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repeater, room server and sensor firmware skip leading spaces and echo
an optional "XX|" prefix at the start of the reply (simple_repeater
MyMesh.cpp:1249-1255; simple_room_server :937; SensorMesh.cpp:385).
The app's RepeaterCommandService matches replies by that prefix, so
the fake must echo it too. Found while planning C1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tool/fake_radio/capture_trace.py records a real radio over USB serial:
the same read-only requests a client sends on connect, plus the
Offband extensions, each request with its exact reply frames. Nothing
is set or sent over the air; draining the message queue is opt-in
because it removes messages from the radio. RTS stays low and
--no-dtr keeps DTR low for ESP32 USB-Serial/JTAG boards (#244).
FakeRadioTrace loads a trace, builds the seed, profile and block list
the recorded radio held, and replays every request into a fake seeded
from it, reporting each reply that differs by step. Channel names are
compared up to their NUL (firmware fills that field with strcpy).
FakeRadioProfile.deviceInfoTailBytes lets older Offband builds with a
shorter DEVICE_INFO tail replay. The app's frame log wasn't usable: it
keeps 500 entries and truncates long frames.
Round trips exact under both profiles and for a v16-style short tail;
a doctored or missing reply is reported. 87 fake-radio tests.
Real-radio traces are captured at D1 (#783).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
failNext(code) answers the next N commands with an ERR and does
nothing; delayNext(code, d) holds the reply for d on the fake clock;
acksToDrop loses that many ACKs; cutContactsAfter sends START and N
contacts, no END, then drops the link. A drop ends the transport in
both adapters: the TCP server flushes and closes its sockets, and the
in-process link calls disconnect(manual: false) as connectTcp's onDone
does. Through the real connector, a cut contact sync leaves it
disconnected over TCP and in-process. 80 fake-radio tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FakeRemoteNode plays a repeater, room server or sensor. CMD_SEND_LOGIN
answers RESP_CODE_SENT tagged with the key prefix, then the node's
new-format LOGIN_SUCCESS (admin or guest) on the fake clock; a wrong
password gets no answer, as simple_repeater handleLoginReq returns 0.
Only an admin session runs CLI (the repeater's isAdmin gate); replies
come back as TXT_TYPE_CLI_DATA messages. Commands and replies copied
from CommonCLI: get radio/tx/path.hash.mode (ftoa3 formatting), set
radio ("OK - reboot to apply"), tempradio (applies 2 s after the reply,
reverts after its minutes), set path.hash.mode 0-2, set tx, ver,
version, Unknown command.
Stock vs Offband, from source: Offband rejects a fifth set radio part
(#299), stock ignores it; stock has no `version` and answers it as
`ver`. 74 tests, driven by the client's own login and CLI builders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SET_RADIO_PARAMS validates like firmware (150-2500 MHz in kHz, 7-500 kHz
bandwidth in Hz, SF 5-12, CR 5-8) and allows client repeat only on the
default repeat frequencies (433.000, 869.495, 918.000); SET_TX_POWER
takes -9 to max; SET_PATH_HASH_MODE takes modes 0-2 and only with a
zero second byte. SELF_INFO reports frequency and bandwidth through the
firmware's float round trip. The client's own frame builders drive the
tests under both profiles (stock matches Offband here). 62 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CMD_SEND_TXT_MSG answers RESP_CODE_SENT with the flood flag, the
expected ACK (composeMsgPacket's SHA-256, matched against the client's
own MessageRetryService prediction) and a timeout; the ACK arrives as
PUSH_CODE_SEND_CONFIRMED on the fake clock. CLI commands expect no ACK.
CMD_SEND_CHANNEL_TXT_MSG is OK/NOT_FOUND; Offband keeps the 8-slot
packet-hash ring and answers 0xC6 with it (unknown sub-codes are
MALFORMED, per firmware). receiveDirect/receiveChannel queue V3 (or
legacy, below protocol 3) frames and tickle PUSH_CODE_MSG_WAITING;
Offband drops DMs from blocked senders, stock delivers them.
Connector check: an incoming DM lands in the real connector's
conversation over the in-process adapter. 50 fake-radio tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The connector scenario runs over TCP and in-process under the Offband
and stock profiles: the client's conclusions match the profile (caps
present on Offband, absent on stock, and no Offband command is sent to
stock). Twenty in-process connects from one seed give one outcome. A5
catches a deliberately wrong constant (manifest_contract_test).
Epic verification: em-dash OK, analyze clean, format clean, full suite
1125 passing, Windows and APK release builds OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reads lib/connector/meshcore_protocol.dart as source and compares every
code and capability bit with the pinned Offband (and stock) manifest:
87 shared names, no mismatches. A doctored constant is caught. The
fake's own code table is checked the same way. The reported version
satisfies every client gate for what the fake advertises (block >= 15,
caplog >= 17, packet hash >= 22), and stock enables none of them.
Finding, documented in the test rather than hidden: the client listens
for pushCodeChannelsChanged (0x91, #429 part A), which no firmware
defines (checked offband-v1.5.0-beta7). cmdGetCustomVar is an alias of
CMD_GET_CUSTOM_VARS (40).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tool/fake_radio/gen_protocol_manifest.py reads companion firmware
source at a git ref and emits the manifest format proposed in
OffbandMesh/meshcore-firmware#1318. Pinned copies, verified identical
to the generator's output:
- offband-v1.5.0-beta7 (53951759): code 22, MeshCore base v1.17.0
- companion-v1.17.1 (stock, d9296435): code 13
FakeRadioProfile.fromManifest takes codes, bits and the DEVICE_INFO
version string (offbandClientVersion() derivation) from the manifest;
naming a bit the manifest lacks throws instead of reading 0. Offband
answers GPS status, the block list (BlockStore dedup/swap-remove
semantics) and the packet-hash query; stock rejects every Offband
command as unsupported.
Found writing it: the A2 default had OFFBAND_CAP_CAPLOG as 0x08 (it is
0x20) and the version string as 1.5.0-1.17.1 (beta7 is on v1.17.0).
Both now come from the manifest. 27 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FakeRadioTcpServer serves the fake on a loopback port with the
companion serial framing (0x3c app->radio, 0x3e radio->app), written
independently of the client codec. FakeRadioInProcess plugs the fake
into sendFrameOverrideForTest/handleFrameForTest with no socket.
lib change, test seam only: connectTcp's post-transport handshake moves
into _runConnectedHandshake (same statements, same order, same
try/catch), and connectInProcessForTest runs it for the in-process
path. A1 (#767) now passes on both adapters and asserts the handshake
commands reached the fake. analyze clean; connector + TCP tests green
(271).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A MeshCore companion radio in software under test/support/fake_radio.
handle() answers the handshake set the client sends (DEVICE_QUERY,
APP_START, GET_CONTACTS with 'since', GET_CHANNEL, SYNC_NEXT_MESSAGE,
time, battery, custom vars, auto-add, other params, advert name); every
reply cites the firmware function it copies. Unknown commands get
ERR_CODE_UNSUPPORTED_CMD, as MyMesh.cpp:3561 does.
Codes are copied from firmware, not imported from the client, so A5
can catch client drift. Stock and Offband differ already: the
DEVICE_INFO tail (82 vs 87 bytes) and set-time (stock refuses going
backwards; Offband #607 accepts). All delays run on FakeClock, never
wall time. 14 unit tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The real MeshCoreConnector over its real TCP path must reach connected
with self info, channels and contacts loaded. The only radio a test can
stand up today never answers: "Timed out waiting for SELF_INFO during
TCP connect". A2/A3 (#601, #768) replace it with the fake radio.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every preset test faked the network, so presets missing from
config-profiles main passed them all and reached the owner as
"Couldn't update presets" on a test build twice. The live test
refreshes from the real URLs and fails on any refresh error; a second
live test proves a missing file comes back as HTTP 404. The picker
test now checks that a good refresh shows no error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two app-side halves of the #702 fix.
The native USB service read one 8 KB chunk per flserial callback, which
left the rest of a burst waiting in the native ring. It now drains
until the ring is empty, bounded at 32 reads (the ring's 256 KB) so a
stuck read cannot spin.
The frame decoder skipped bytes it could not frame (noise, an oversized
length) without a word, so when bytes were lost upstream, whole frames
vanished with no trace. It now counts them and keeps the first 16; the
native USB, web USB and TCP services log each batch as an error with
the count and a hex sample (SAFELANE 6). The web service shares the
decoder, so it gets the same logging, matching the plan's "all
transports" intent.
Tests cover no report on clean input, noise before a frame, an
oversized header, take-once, the capped sample and reset; with the
count disabled, 4 fail.
Epic #702.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 30 s staleness rule only ran when a later getContacts call checked it.
If the radio drops END (firmware #1283 can refuse it like any frame) and
nothing else asks for contacts, the request stayed in flight: the loading
state stuck and a queued refresh never ran.
A watchdog now fires at the stale mark, re-arms if frames are still
arriving, and otherwise ends the request and runs the queued one. It never
prunes: an unfinished stream is not a complete sync.
Found by the pre-PR Gemini review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The banner sits in MaterialApp.builder, above the Navigator, where
there is no Overlay. Its close IconButton had a tooltip, and a Tooltip
without an Overlay throws ("No Overlay widget found"). In the owner's
release build that painted the window gray the moment the pointer
reached the button.
The close button drops the tooltip and keeps the accessible "Close"
label on the icon. New tests mount the banner in MaterialApp.builder,
as the app does, and hover the close button; both failed before the
fix with the Overlay error and pass now. The earlier tests mounted it
under home:, which has an Overlay, so they could not catch this.
Epic #668.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The firmware refuses a second CMD_GET_CONTACTS while it is streaming
(ERR_CODE_BAD_STATE), and the app had no contact handling for that
error. Two refreshes that overlapped could leave the in-flight state
tangled, and a request the radio refused left the list half-synced.
A request made while one runs is now queued and sent after END (a full
request wins over an incremental one). A request with no contact frames
for 30 s is treated as lost, so a missing END cannot block every later
refresh (owner decision on #672; the hang itself stays with #86/#504).
An ERR before the stream starts, when no caplog download or tracked
command could own it, ends the request and keeps the saved list. A
send that throws resets the in-flight state.
Tests cover queueing, the queued request running after END, full over
incremental, ERR, the 30 s stale rule, keep-alive from contact frames
and a failed send; with the guard disabled, 4 fail.
Epic #668.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A short contact sync is now loud (SAFELANE 6). A banner above the whole
app says the radio reported N contacts but sent M and that the saved
contacts were kept; it stays until dismissed. When the automatic retry
is short too, a modal asks: Keep my contacts (the default, focused, so
Enter keeps) or Use the radio's list, which states how many contacts it
would remove. Owner decisions on #670.
The banner sits in MaterialApp.builder next to the storage banner
(#385), above the Navigator, so the modal is drawn in place rather than
pushed as a route. Strings are English; other locales fall back through
untranslated.json, as the storage banner's do.
Widget tests cover hidden, shown with counts, the no-total wording,
dismiss, the decision's default and both choices; with the Keep default
removed, two fail.
Epic #668.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ContactStore.loadContacts returned an empty list when the stored JSON
failed to decode, and the next save wrote the in-memory list over the
stored contacts. A read failure was treated as "no contacts".
A decode failure is now logged as an error, the raw value is kept
under contacts<key>.unreadable-<timestamp>, and saves to that key are
refused (and logged) until a load succeeds. Other radios' keys are
unaffected.
Tests cover the round trip, the failure report, the raw copy, the
refused save, recovery after a good load, and another radio's key;
with the refusal disabled the save test fails.
Epic #668.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full contact sync cleared the app's list, then saved whatever the
radio streamed as the whole list. The owner's RAK declared 350 contacts
and streamed 106; the app kept the 106 and silently lost the rest,
favorites included (#660).
A full sync now leaves the local list in place and records which
contacts the radio delivered. Only a complete sync (received equals the
declared total) drops the contacts the radio no longer holds. A short
or undeclared sync merges what arrived, removes nothing, logs an error,
and retries once per connection. If the retry is short too, the
connector exposes a pending decision (keep local, default, or use the
radio's list) for the UI in #674.
Removes the now-dead _preserveContactsOnRefresh flag. Adds test-only
seams to feed frames and capture sent frames. Tests cover complete,
short, undeclared, retry bound, both decisions, mid-sync adverts and
incremental sync; with the old clear reinstated, 5 of them fail.
Epic #668.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same gap as the companion form: a repeater on the USA values with a
1- or 2-byte path hash matched MeshCore's "Canada" (3-byte). The remote
matcher now takes the node's path hash mode and applies the same rule.
Epic: #733
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MeshCore's "Canada" and "USA" share 910.525 / 62.5 / SF7 / CR5 and
differ only in path hash (Canada 3-byte). Matching ignored path hash,
and Canada sorts first, so a USA radio showed "Canada" (D1 screenshot).
A preset with a path hash size now matches only a radio on that size;
presets without one match as before.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picking a preset that carries a path hash size sets the screen's
existing path hash field to the zero-based mode, so Save sends
`set path.hash.mode N` alongside the radio params.
With "Apply temporarily" checked, a preset's path hash is held back:
firmware has no temporary path hash, so it would outlive the tempradio
revert and leave the node off its mesh. A note says so on screen, and
the value stays pending for a normal save. A path hash the user sets by
hand is always sent. (Default chosen here; flagged for the owner.)
Epic: #733
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A checkbox on the remote-node radio card switches Save from
`set radio` (persisted, applied after a reboot) to stock `tempradio`
(applied now, reverting after the duration, nothing saved). The
duration defaults to 1440 minutes (owner decision) and is limited to
1-35791: firmware schedules the revert at 2000 + minutes * 60000 ms in
a 32-bit int, which overflows beyond that. Because tempradio retunes
the node 2 s after it replies, it is sent after every other command in
the same save. Coding rate goes out as the 4/x denominator, which is
what firmware range-checks. Unchecked behaviour is unchanged.
Epic: #733
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The remote-node radio card gains the same grouped RadioPresetPicker as
Radio Settings. Picking a preset fills frequency, bandwidth, SF and CR
and marks the radio field dirty, so Save sends the existing `set radio`.
TX power is untouched: on these nodes it is a separate command. Room
servers share this screen (contacts_screen.dart:1063), so they get it
too. The selection is matched from the current fields to the nearest
kHz (repeaters report e.g. 908.205017). The list refreshes when stale.
Epic: #733
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RadioPreset.frequencyHz returned kHz; renamed frequencyKHz (the unit
CMD_SET_RADIO_PARAMS carries). The picker is disabled while a refresh
runs, so a pick can't vanish when the refreshed list lands, and the
selected-item builder uses an id-to-title map.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saving Radio Settings already sends radio params (cmd 11) and TX power
(cmd 12). When the selected preset carries a path hash size, save now
also sends CMD_SET_PATH_HASH_MODE (61) with the zero-based mode. It is
sent whenever the preset has one, not compared against the reported
width, because that reads as 1 when device info is short (#240).
Off-grid repeat handling is unchanged.
The CMD_SET_RADIO_PARAMS comment said the frequency was in Hz; stock
firmware stores freq / 1000.0 as MHz, so it is kHz. Comment corrected.
A frame test pins the bytes a preset puts on the wire.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Radio Settings now takes its presets from RadioPresetService instead of
the hardcoded list, which is removed (radio_settings.dart keeps only the
LoRa enums). The picker, extracted as RadioPresetPicker for reuse on the
remote-node screen, groups presets under non-selectable region headers,
labels each MeshCore or Offband, and shows where the list came from with
a refresh button; a failed refresh stays on screen in the error colour.
Selection is tracked by preset id rather than list index, because a
refresh can change the list under an open form. Upstream presets carry
no TX power, so a preset without one matches any power and applying it
leaves TX power as it is. The form refreshes a stale list when opened.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RadioPresetService starts from the last good copy of each preset file,
or the copy bundled in assets/radio_presets/ (config-profiles 857d4e9),
so the picker works offline. refresh() fetches both files from
config-profiles; each file that parses becomes the new saved copy, and
one that fails or comes back empty never replaces a good one. Failures
are logged and kept in refreshError for the picker to show.
refreshIfStale() refreshes at most every 12 hours. The merged list puts
the overlay over upstream on a matching title, sorted by region.
An overlay edit in config-profiles therefore reaches users on their
next refresh with no app release (test: "an overlay edit reaches the
app with no new build"). Closes the gap recorded in #648.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Presets publish path hash size in bytes; firmware takes a zero-based
mode (1 byte = mode 0, 2 = 1, 3 = 2). RadioPreset.pathHashMode does
the conversion and returns null when the preset carries none or an
out-of-range size, so nothing is sent. Tests pin all three sizes and
that a published 2 never becomes mode 2.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RadioPreset carries frequency, bandwidth, SF, CR, and optional TX power,
path hash (bytes) and off-grid flag, plus its region and source.
parseUpstreamPresets reads the mirrored MeshCore list (string numbers);
parseOverlayPresets reads Offband's overlay (JSON numbers, retired
entries dropped). Malformed entries are skipped and counted; a wrong
format or a newer format_version is rejected. Upstream titles carry no
region, so upstreamRegionFor derives the picker group from the title.
Epic: #726
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three accepted findings, plus a real defect the adversarial test cases
flushed out.
A long name overflowed the chip by 405 pixels. The name comes off a
public radio channel and is attacker-controlled, so anyone could break a
message list by posting a card with a long name. The label is now
bounded and ellipsized, with an explicit width ceiling because a
WidgetSpan hands its child unbounded width.
fromChannelShare no longer scans from the first < to the last >. Two
cards in one message were read as a single span running from the first
key to the last name. That was reachable: the add dialog passes raw
pasted text straight to it. It now takes the first well-formed card via
a regex whose name class cannot cross a closing bracket.
The known-contact check is O(1) against the connector's existing
_knownContactKeys set, through a new isKnownContact. Scanning contacts
ran per chip on every notification, and the public knownContactKeys
getter copies the whole set, so neither belonged in a build method.
Card-versus-mention is now carried on the match instead of inferred from
text[m.start] == '<', which would mis-route the day a third bracketed
pattern is added.
Two findings were rejected on evidence and are justified in the PR body:
a claimed missing null terminator (firmware sets it from the frame
length itself) and a claimed greedy-regex failure (disproven by test).
Epic #610.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>