Both from the adversarial review gate, both regressions this branch
introduced rather than pre-existing faults.
1. `timeoutMs` reaches updateMessageFromSent as a raw readUInt32LE off the
RESP_CODE_SENT frame with nothing bounding it. While the local
computation overwrote that value it did not matter; making the radio's
estimate a floor meant a garbage frame could arm a timer 49 days long,
and one message in flight per contact is a queue invariant, so that
wedged every later DM to that contact until an app restart. Clamped to
60 s, about four times the longest real round trip in OB-ZRNBY.
2. The pinned-route write was gated on `message.retryCount == 0`, so a user
changing the override between attempts left the radio transmitting the
old pin while this side had already re-armed its timeout and its
path-weight bookkeeping for the new one. `updatePendingContact` hands the
new override to the retry in flight, so attempt 0 is the wrong key. Now
keyed on the route itself: a change is written, an unchanged pin is not.
That keeps it from becoming the per-attempt re-assert #1198 removed.
Tests, both proven to fail first: 4294967295 ms armed where 60000 was
required, and the new pin never reaching the radio. The unchanged-pin case
is covered too, at maxRetries 3 so the retry under test is an ordinary
attempt rather than the final flooding one, which would have passed for the
wrong reason.
Third review finding, not fixed, justified: existing installs without a
stored `max_message_retries` move from 5 attempts to 3 on upgrade. That is
the ruling, it applies to everyone by design, the slider still spans 2 to
10, and the total time to failure is comparable because the window widened.
Upload OB-ZRNBY carries 24 completed round trips as measured by the radio
in PUSH_CODE_SEND_CONFIRMED: median 6771 ms, p90 12394 ms, against windows
this code armed with a median of 4884 ms. Over half of all ACKs arrived
after the attempt that earned them had timed out. 83 DMs cost 311
transmissions, 46 reached the final attempt and 23 were shown as failed.
Owner ruled p90 rounded up, 12.5 s, with three attempts rather than five.
Three changes:
1. A floor of 12500 ms on the window actually armed for a DM's ACK, in
MessageRetryService. The airtime formula under-predicts because airtime
is the wrong dominant term: on a multi-hop mesh the time goes into
repeater forwarding delay and TXT_ACK_DELAY, and no coefficient on
airtime fixes that.
2. The radio's own est_timeout from RESP_CODE_SENT is a floor, not a
second opinion. It was overwritten outright by the local computation,
which is how a 3252 ms radio estimate became a shorter local window and
lost an ACK that came back at 3448 ms. Now max() of the two, then the
floor.
3. Three attempts, not five. At the wider window three attempts give up
after about the same elapsed time as five at the old one, while putting
roughly 40% less traffic on a shared mesh. It also keeps every attempt's
ACK hash distinct: the firmware masks `attempt & 3`, so attempt 4
collided with attempt 0 and the first and last attempts were
indistinguishable.
The floor deliberately does NOT live in calculateTimeout. That method also
feeds calculateCliTimeout, and flooring it there added 11.5 s to every
repeater CLI command and broke eight #533 tests: a separate surface with
its own budget arithmetic that nobody ruled on.
Tests, all four proven to fail first with real numbers: the formula armed
1300 ms for a flood and 1050 ms for a zero-hop send; maxRetries read 5;
the radio's 14000 ms estimate was replaced by a 1200 ms local guess. Also
asserts the formula is still unfloored so the CLI budget stays put, and
that attempts 0 to 2 keep distinct ACK hashes while 4 collides with 0.
A test seam lowers the floor, since a 12.5 s wall-clock wait per attempt
is not something a unit test can drive.
One test was written, passed against the reverted code, and deleted rather
than kept: that a short text cannot buy a shorter window than a long one.
_estimateAirtimeMs falls back to a fixed 50 ms when the radio parameters
are unset and there is no seam to set them, so it passed for the wrong
reason. The gap is recorded in the test file instead.
Not in this change: extending the 30 s late-ACK grace. The 76521 ms sample
in the capture says the tail exceeds it, but that sample may be a
store-and-forward delivery rather than a live round trip and it has not
been checked.
Ben read "Retry 4/5" on a failed DM and concluded the fifth attempt never
ran. The log from OB-3UJZR proves it did: at 17:38:38 the client sent
CMD_RESET_PATH and then attempt 4, so the flood fallback fired exactly as
ruled. The label was wrong, not the loop.
`retryCount` is a zero-based attempt index and `maxMessageRetries` is a
count of attempts, so the chat label printed one against the other. The
fifth and final attempt of five read as "4/5", which reads as a sixth
attempt still to come.
The AckHash log line had the same fault twice over: it printed the raw
index, and it said "retrying" on the final timeout, when the message is
in fact being marked failed. Both now read from 1 and say which it is.
No l10n change: `chat_retryCount` keeps its "Retry {current}/{max}" form
in all 18 locales and only the number passed in changes.
The flood fallback clears the stored path on the radio, so without this a
hand-picked route stopped being honoured after one bad send while the UI
still claimed it. That is the silent failure that got "Direct" removed,
so leaving it was not an option. Owner ruled option (a): re-push the
override once at the start of each send.
This is not the defect #1198 removed. That was a client-side snapshot of
a path the RADIO had learned, re-asserted before every attempt, able to
overwrite a fresher route the radio had just picked up off the air. This
is the user's own explicit choice, written once, at the start of a send,
and it has to be written because the previous send's final attempt may
have cleared it. One write per send, never one per attempt.
`RetryServiceConfig.setContactPath` now carries `hashWidth`. The callback
dropped it, so a 2-byte route would have been written at width 1 and
re-read as twice as many 1-byte hops, routing to the wrong nodes (#279).
That trap was latent while no path write existed on this path; adding one
back makes it reachable, so the signature closes it.
Tests: a pinned route is written exactly once per send and at the width
it was captured at, and the retry after it writes nothing.
Clearing the stored path and flooding is the only recovery the wire
protocol offers: the radio routes a DM direct whenever it holds a path,
there is no per-send routing field, and flood is how the mesh teaches it
a new route. That makes the fallback part of sending a DM, not a
preference. Owner rulings on #1222:
R1(b): `autoRouteRotationEnabled` is deleted rather than flipped. It
shipped false, so the fallback was unreachable out of the box. Deleting
it also un-hides the route-weight and "Max Message Retries" sliders,
which were behind that toggle while their values applied to every send
regardless. `preparePathForContactSend` keeps flag-off behaviour
explicitly: dropping the gate there would have switched repeater, room
and telemetry command sends over to rotated paths, which nobody ruled on.
R2(a): "Direct" is removed. A forced zero-hop path bought no
reachability, because a DM is matched on the destination hash with no
check of route type or path position, and Auto already settles on zero
hops for a real neighbour. What it did buy was a sticky mode that
suppressed the fallback and failed silently once the contact moved out of
range. A zero-hop override is normalised to Auto at every entry point:
setPathOverride, both contact stores on load, path resolution, and the
labels. Nobody is stranded in a mode the UI no longer offers.
R3(b): `clearPathOnMaxRetry` is retired. It fired after the last attempt
had already failed, so it could only ever help the next message, and the
final attempt now clears the path itself.
R4(a): the final attempt floods even for a hand-picked path. An override
still chooses the route for every earlier attempt.
Tests, three of four proven to fail against the old gating: the selector
runs with no settings service wired at all (was skipped entirely), a
zero-hop override does not suppress it, the fallback does not depend on
the path-history service existing, and an override floods on its final
attempt while writing no path to the radio.
Not in this change: the dead l10n keys the removed toggles leave behind,
and what should re-establish a user's pinned route after the final flood
clears it on the radio. Both noted on #1223.
A user's iPhone dropped its BLE link 44 times in 3 hours, and no log line
said why. Every drop came from the OS through the connectionState
listener, which ended the connection without recording a reason.
Each OS-reported drop now writes one line:
- the platform's disconnect reason (the CoreBluetooth code on iOS and
macOS, the HCI status on Android),
- the seconds since the last frame from the radio,
- the app lifecycle state.
Windows, Linux and web report no reason, and the line says "not
available on <platform>" (#1187 tracks getting a real one there). The
reason is read one microtask after the event, because flutter_blue_plus
records it in its own listener on the same event.
main.dart logs every app lifecycle change and passes the state to the
connector, so a drop can be lined up against iOS backgrounding the app.
Diagnostics only: the disconnect and reconnect flow is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A banner above the app on the next launch: Send (opens Send to Offband), Not now, Don't ask again. "Send crash logs automatically" is off unless turned on; when on, a definite failure is sent without asking and the banner appears only if that send fails. An exit that cannot be placed is always asked about, never sent automatically. Both switches are in the Debug settings. New strings English only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run marker records whether the app is on screen and whether an unhandled Dart error happened; a clean exit removes it (awaited before a desktop window closes). At the next start, a marker left on screen is an unexpected exit, one left in the background is the OS reclaiming memory and is not offered, and an unreadable one is asked about. New Android ANR and crash exit records (not backfill) name the failure. Failed image loads do not count. On web only an unhandled error counts, since closing a tab is not an exit Flutter sees.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision on #1190 (2026-11-27): a sender can leave a name or
screen name and an email so the owner can follow up. Both are optional,
with a note that without them we cannot reach the sender with an update.
They go into the encrypted package as sender.json, never into a header,
so the plain-text intake issue never shows them. With both empty the
package goes out byte-identical to before. A mistyped email blocks the
send and says why rather than sealing an address nobody can use.
Both new tests were run against code with the sender dropped and the
email check removed, and failed; the rest of the suite still passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Next to Share on both log screens and in the Debug settings. It says what is sent (messages and radio traffic, passwords and PINs removed), that only Offband can read it and that it is deleted 30 days after review, takes an optional note, and shows the reference code with Copy. A failure stays on screen with its reason and Retry resends the kept package. New strings are English only; untranslated.json is updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Web has no log files, so textPackageZip zips the log text the screen hands over, through the same redactor, with the manifest. Also from the Gemini review: log files are now redacted as a stream, line by line, and old packages are cleaned from their own temp folder instead of by listing the whole temp directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seals the zip to Offband's public key (key id 7fbd1b06, made by offband_logs.py keygen) and POSTs it to logs.offband.app. A 201 must carry a well-formed code; 413, 429, 400/411, other statuses, no network and no answer each come back as their own failure, never a throw, so the screen keeps the package and offers Retry. A package over 25 MB once sealed is refused before anything is sent. The note is trimmed and percent-encoded; a blank note sends no header.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ephemeral X25519, HKDF-SHA256 and AES-256-GCM with the 53-byte header as additional data, in the format the log-intake Worker checks. Uses the vetted cryptography package (2.9.0). The test vectors come from Python's cryptography library via tools/logs/make_envelope_vectors.py, an implementation independent of the app, and the Dart output matches them byte for byte; the pull tool will open the same vectors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LogPackage gathers every log file and the Android exit traces, re-runs the redactor over each line oldest first (so logs written by earlier builds lose their passwords too), and adds manifest.json with the app version, commit, platform, OS and radio model, firmware and caps. Share and Save now hand over these redacted copies, never the files in the log folder. zip() is what Send to Offband will upload. archive moves from transitive to direct at the locked 4.0.9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every frame is redacted before it reaches the log file or the in-app log. Blanked: repeater and room login passwords, the device PIN (sent, and in the device info reply), CLI password, guest.password, bridge.secret, pin and wifi.pwd values, the password now: echo, the reply to a get of any of them (paired by its cc| prefix, or in order when sent without one), and observer config passwords. The private key keeps its first 3 bytes. Channel keys and unknown incoming codes stay byte for byte (owner decisions on #1190). Repeater reply lines in the app log get the same treatment. Gemini review fixed: exact reply pairing, NUL inside a secret, newline in a config value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contacts, favorites included, disappear (#1167), and every removal was
logged as a count, so nothing showed which contact went or why. This is
the first step of #1167: name each one, then fix the path the log names.
Which contacts are removed does not change.
- Each path that drops a contact, or asks the radio to delete one, logs
a line per contact: name, short key, favorite flag, the path, and the
connected radio. The paths are a complete sync that did not include
it, a "not found" answer in recovery, the owner choosing the radio's
list, a user delete, and a synced contact holding the radio's own key.
- The radio's push for a contact it overwrote to make room (0x8F) and
for a full table (0x90) are logged. 0x90 is logged once per
connection, since the radio sends it for every node it cannot add
(Gemini).
- The radio's auto-add settings, read at every connect, are logged,
overwrite oldest included, so each removal reads against them.
Rebased onto #1028 (PR #1185), which already handles 0x8F and 0x90: it
drops the overwritten contact and tracks the full table. The logging goes
into those handlers instead of a second pair of cases, and the 0x8F test
now expects the contact removed here, as #1028 does. The owner tested
this same combination on hardware in the combined build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every path that can take a contact off the radio now has a test:
- A contact frame carrying the radio's own key is removed from it. After a
Bluetooth switch or a dropped link, the previous radio's key no longer
counts as "self", so the next radio keeps its contact for that radio.
Shown to fail with the key-clearing lines disabled (2 of 4 fail).
- A user delete removes only the contact chosen and keeps the others' DMs.
Gemini review fix: a pasted contact that does not parse came back null, and
the paste ended with no message. It now says "Invalid contact data" and the
message stays until dismissed. The new test fails without the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner's prune test, 2026-11-24 (Windows, Bluetooth): the radio answered
CMD_REMOVE_CONTACT with OK 580 ms later, and the app reported "the radio
didn't respond" after 5 s.
OK/ERR replies are matched to commands by order. sendFrame added a
command to that queue only after the transport write returned. A
Bluetooth write on Windows can return after the radio's reply has been
handled: that reply then matched nothing, and the late entry sat at the
front of the queue and took the next command's reply. A channel message
sent earlier on that connection is the likely source; the removal's OK
went to it.
- sendFrame registers the reply slot before writing, and removes it if
the write fails. The write itself moves to _writeFrame.
- Test overrides now go through the same registration, so tests see the
real ordering instead of skipping it.
Tests: generic_ack_order_test.dart plays the radio answering inside the
write. "An OK that lands during the write still marks the message sent"
fails on dev (the message stays pending); the other two check the next
command gets its own reply and a failed write leaves nothing waiting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner test of the first build (2026-11-24): an add from a channel on a
full RAK4631 went straight to the radio, which overwrote "Somerville
(OH) Yagi" to make room (overwrite-oldest was off; the Offband firmware
makes room on a manual add by design). The app only said so afterwards.
- A new contact is not sent while the radio is full: full once a
complete sync reaches the limit, the radio pushes CONTACTS_FULL or
CONTACT_DELETED, or refuses an add as TABLE_FULL; clear again after
a removal the radio confirms. An update to a held contact still goes.
- Every add path (by key, Discovery, map, channel sender, paste) then
asks: remove the suggested contact (least recently heard
non-favorite, with when it was last heard), prune stale contacts, or
cancel. The add is sent again only after the radio confirms the
removal. Cancel sends nothing.
- #1182: Prune stale contacts, from the contacts menu and the prompt.
Non-favorites not heard in 15, 30 or 90 days (30 by default), all
ticked. Removed one at a time, each on the radio's OK; stops at the
first failure and says which. DMs are kept. A contact added on this
connection is never offered.
- Owner decisions 2026-11-24: 30 days default, 15/30/90; pruning keeps
DMs; the firmware behavior stays.
Tests: contact_add_confirm_test.dart gains 4 tests on dev's API; 3 fail
on dev (a full radio is sent the add). contact_prune_test.dart (17) and
contact_make_room_test.dart (8 widget tests) cover the prompt, prune,
removal results and the stale rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner's log showed CMD_ADD_UPDATE_CONTACT drawing ERR 3 (table
full) while the app logged "Added new contact" and kept it. Every DM to
that contact then drew ERR 2 (not found) and went red only when the 8 s
timer ran out, with no reason.
- Both add paths (by key, and from Discovery, the map or a channel
sender) wait for the radio's OK or ERR. The contact is kept only on
OK. A refusal or no answer keeps nothing and tells the user which,
with "full" said plainly. Owner decision 2026-11-23.
- The Discovery add now waits for its own reply, so its ERR can no
longer be taken as the answer to the next command.
- A DM the radio refuses fails at once and keeps the radio's error
code, which the failed bubble shows. Matched only when exactly one DM
is waiting and no ERR-drawing stream is running.
- The radio removing a contact to make room (push 0x8F) removes it from
the app and names it; its messages are kept. The radio reporting
itself full (push 0x90), a refusal for a full table, or a complete
sync at capacity raises a notice on the contacts screen.
- New strings are English-only; untranslated.json updated.
Tests: contact_add_confirm_test.dart uses only dev's API, and 5 of its
9 tests fail on dev (refused add kept twice, the Discovery ERR taking
the next command's reply, the refused DM pending, the removed contact
kept). contact_add_result_test.dart (17) and 3 new dialog tests cover
the results, the notice, the stored reason and the negative cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Epic #1155, owner decision 2 (2026-11-19): block the write, not only the
button. LocalCliService.run refuses before building frame 66 when
supportsLocalCli is false: nothing is sent, a warning is logged (without
the command text, which may hold a secret), and LocalCliUnsupported is
thrown. LocalCliTransport maps it to CliConsoleUnsupported, and the
console adds a row that stays in the transcript: "<cmd>: not sent. Your
radio's firmware doesn't support the device CLI." English key only;
untranslated.json regenerated (17 locales fall back to English).
The existing local CLI suites now connect a stock 1.18 radio first,
since an unclassified connector no longer sends frame 66.
Tests: 40 pass across the service, console and transport suites. With
the refusal check removed, the 2 refusal tests fail.
Agent: BrightForge (session 440fbe94)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Epic #1155. The Settings Device CLI row reads supportsLocalCli; the
companion chat menu's CLI console and the contact Remote CLI switch read
supportsRemoteCli. The switch was shown on every radio, including ones
that ignore flag 0x10 (owner decision 1, 2026-11-19). When the switch is
hidden, Close passes remoteCli: null, so a stored grant is left exactly
as it was rather than cleared.
Tests: 33 pass across the gate, Settings entry, contact dialog and
console suites. With the old gates put back, 4 fail.
Agent: BrightForge (session 440fbe94)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Epic #1155. Tags claimed on firmware-base 8d94ef78 (firmware #2211),
emitted by firmware #2213. resolveCliSupport gives stock 1.18+ both
surfaces from the classifier and an Offband radio each surface only when
its tag is present; no advert, a refused advert, or an advert without the
tag leaves it hidden. Connector exposes supportsLocalCli and
supportsRemoteCli and logs both when the advert settles. No UI uses them
yet.
Tests: 16 in cli_advert_gate_test.dart; with the old stock-only gate put
back, the 5 tag-present cases fail.
Agent: BrightForge (session 440fbe94)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both Apple builds kept Flutter's default bundle names. The iPhone app,
installed on a Mac from the App Store, was labeled "Runner", and the
notarized Mac app showed as "offband_meshcore" in Finder.
PRODUCT_NAME is now "Offband MeshCore" for the iOS Runner target and the
macOS app. Bundle identifiers are unchanged, so app data stays put. CI
uses the new paths and fails if the name regresses: CFBundleName on
macOS, the .app folder in the IPA on iOS.
When the iPhone app runs on a Mac (ProcessInfo.isiOSAppOnMac, read over a
small platform channel), a one-button notice says it is the iPhone
version in a fixed phone-sized window. Once per app version, with no
link elsewhere, by the owner's decision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sending the same channel text twice quickly showed one message, with the
second send counted as a repeat. The two sends are two packets: the client
gives each its own second, and the firmware puts that second at the start
of the encrypted payload, so their packet hashes differ.
The client merged them anyway. Its own message is filed before sending
with no packet hash, so the exact-hash pass cannot see it, and the
fallback treated same text + same sender + within 30 seconds as one
message. Repeats arriving later fell to the same rule, because the RX
log and the sync queue hash differently, and landed on the newest
same-text message.
The fallback now requires the same timestamp second. A real repeat is
the same packet, so it carries the sender's exact second, and both
receive paths read it from the packet. The 30-second window dates from
before #524 stamped the outgoing message with the exact second sent.
Tests drive real frames (0x88 RX log and V3 queue) through the
connector. 7 of 9 fail on the old rule; the 2 controls pass on both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The radio is the only thing that hears the mesh, so what it feeds is
the truth and a value the app stored never beats it (owner ruling).
- A contact sync copied the discovered entry's coordinates over the
radio's (getFromDiscovered), so a stale value, often a 0,0 from a
repeater heard before its location was set, hid the real location on
every sync and was written back. It now copies only the raw advert,
which the contact record does not carry.
- A radio record with no location kept the old one; it now clears it.
- A raw advert without a location, or with 0,0, kept the old one and
stored 0,0 as a value. The newest advert now sets the location,
including "none", and 0,0 is unknown at parse time.
- An advert older than the one applied leaves the location and its age
alone, unless the applied one is dated ahead of the phone: one advert
from a clock set in the future must not freeze a node (Gemini).
- Packet Path shows each hop's coordinates with the age of the advert
that carried them. A last known location never ages out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the adversarial review of this branch:
- A disconnect while a write waited on its re-read left the wait to its
30 s guard. Every disconnect passes _resetSyncProgressState, which now
ends that wait at once.
- The per-radio history delete snapshots what is stored before deleting,
as #1128 does, and empties the screen first, so a message arriving
mid-delete survives on screen and on disk.
- The copy cleanup also holds aside the frozen pre-row blob of a key it
leaves with no rows. Otherwise the load falls back to that blob and
the copies come straight back.
- A Resync that fails to start is logged instead of dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings > Actions gets "Delete message history": the connected radio's
channel messages and direct messages, removed from the app after a red
confirm. Contacts, channels and settings stay. The owner's ruling: start
fresh for a radio, channels and DMs together.
Clear Chat on a channel or a contact saved the emptied list. Saves
merge since #343, so that deleted nothing and the history came back on
the next load. Both now confirm in red and delete the stored history,
the channel's by its own PSK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A channel add, rename or delete the radio did not answer was reported
as unconfirmed at once, while the re-read that would settle it was
still running. The write now waits for that re-read and reports done
when the slot holds the change. The error shows only when the re-read
disagrees or cannot finish, and it carries a Resync button. A delete
confirmed this way clears the deleted channel's history by its own key,
since its slot no longer resolves to it.
The Channels screen gets a Resync action in the app bar. The only
other way to resync was pulling the list down, which nothing said.
During a running sync, Resync explains why it is waiting instead of
doing nothing.
New string channels_resync is English-only; untranslated.json is
regenerated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post-sync check compared the radio's channels with the saved list,
so a slot whose history had been loaded under some other list kept it.
Each slot now records the channel key its in-memory history was loaded
under, and a confirmed sync reloads any slot whose channel differs.
Every history load and every filed message logs the radio, slot,
channel name, PSK fingerprint and which list answered. The Nov logs
could not show the misfile because nothing recorded which history a
slot held; this does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Bluetooth radio switch saved the previous radio's messages into the
next radio's channels. Each copy kept the original's receive time
exactly, which two separate receptions never share, so the copies can
be found.
The original is on the radio that was connected when the message
arrived, judged from each radio's own receptions. Where exactly one
radio was connected, the others' rows are moved to a held_1163_copy key
nothing reads; they are not deleted and can be moved back. Where no
radio or several were connected, nothing is touched. Runs once at
startup, logs its counts, and retries on the next launch if it fails.
On a copy of the owner's Windows store: 2,864 rows held aside, 294
messages left alone, every held row's original kept, and no held agent
alert taken from the channel those alerts belong to.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native Bluetooth connects never ran _resetConnectionHandshakeState
(web only), so the #472 clear never happened there. The last radio's
messages stayed in memory under their slot numbers, and the next message
on that slot from the new radio saved the whole window into the new
radio's channel. The owner's Windows store held 2,893 such copies.
Every connect now drops the previous radio's message windows, DM
conversations and channel lists, on every transport. Saves write only
the messages a change added or replaced, never the whole window, so a
wrong view can no longer become stored history.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Applies the Gemini review: the rotation gate change was outside this issue's scope, so rotation SET stays on supportsIndicators. Adds a test that a new radio's device-info drops the previous radio's advert tags.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
caps2 0x04 INDICATORS answers display AND LED with one bit, so a board
with a real display and no controllable LED showed the Status LED
switch, and the radio refused the write with [0xC5][0x7F][0x06]
(firmware #2065: T096, T1000-E, QCC badge).
Firmware PR #2080 (merged on firmware-base, c835aeca) adds advert tags
0x04 TAG_DISPLAY_CONTROL and 0x05 TAG_LED_CONTROL. The precedence comes
from the header, in the same shape as channel notify:
- the advert carries either tag: the tags decide, the bit is ignored
- the advert answers with neither tag: the bit answers both
- no advert (pre-0x1C radio, or not answered yet): the bit answers both
The Display block and the Status LED switch are now gated
independently. The Indicators row shows when either one is present.
Each SET is refused locally unless its own capability is present.
There is no GET-and-read-the-refusal probe.
Client half of OffbandMesh/meshcore-firmware#2069.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner's first radio log showed the key-change lines but nothing for
the hidden-history check, so "ran and found nothing" could not be told
from "did not run". Every channel sync now logs either the check's
result (keys checked, channels on the radio, keys deleted) or why it was
skipped: erased slots, unconfirmed slots, a partial sync, no device info,
or a write in flight.
Also makes the key-change test helper wait for each set-channel frame in
real time: the history move can decode on another isolate, so a fixed
number of microtask turns raced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner ruling: a channel's message history either stays or goes, never
kept hidden for a later re-add.
- Edit Channel asks Keep or Delete when the key changes (hashtag rename,
new private key). Cancel writes nothing. Same-key renames ask nothing.
- The answer is applied once the radio confirms the clear. Keep moves the
rows (copy, verify, delete only what was copied, repeat) and the phone
notify mode; Delete removes the old key's history.
- After a sync that saw every slot, confirmed them all, found none erased
and had no write in flight, history no channel on the radio shows is
deleted, each key logged. Restore's case (erased slots) and partial
syncs delete nothing; a radio with no channels deletes nothing.
- A different channel over a slot is settled by that sync, since 1.7.0
firmware may move the occupant rather than wipe it.
- Keep history that could not land (add refused, move failed) is spared
for the connection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner's rules, 2026-11-09, after a research pass on prompt timing (Google's
in-app review guidance, Apple's 3-per-365-days cap, and donation prompts in
other open-source apps):
- first shown on the 3rd launch, and no sooner than 7 days after the first
- Not now, or closing it, sleeps 30 days
- Sponsor sleeps 90 days
- Never Show Again (renamed from "Don't show again") ends it
- upgrades no longer bring it back on their own
- the text adds that support is always available from About in Settings
or at offband.org/donate
Test builds (GIT_SHA defined) skip every wait and show it once per commit,
even after Never Show Again, so each test build can be checked.
Tests: 16, each rule with its own test; six guards removed in turn (3
launches, 7 days, the sleep check, the 90-day Sponsor wait, Never, once per
commit) and each failed a test. Full suite 2079 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test builds share a version and build number, so the sponsor window would
show only for the first of them. A build passed --dart-define=GIT_SHA=<sha>
is now known as 1.8.0+69@<sha>; a build without it (CI releases, whose
build number always changes) stays 1.8.0+69.
Tests: two commits of one version each show it once; the gate test passes
with and without GIT_SHA defined, and failed with the old fixed expectation
when it was defined. Full suite 2076 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SponsorPromptGate wraps the first screen and, once it has drawn, shows a
Support Offband dialog: Sponsor (opens offband.org/donate), Not now, and
Don't show again. It shows once per installed version and build, saved
before the dialog opens so a crash can't loop it. Hidden on iOS, as the
About screen's Donate link is (#1051). A link that fails to open shows the
About screen's persistent "Could not open the link".
Both keys are app-wide and classified in scoping_inventory.dart. English
strings only; untranslated.json regenerated.
Tests: 10 widget tests plus the wiring through the gate. Each of five guards
(iOS, Don't show again, same version, the gate's call, the failure message)
was removed in turn and a test failed. Full suite 2074 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision 2026-11-07: drop the wait. With the box ticked, the radio's
app data is deleted as soon as the reset is sent and the link is closed,
the same way Reboot just reboots. The pending record, the key check on the
next connect, and its complete / kept / did-not-happen messages are gone.
A failed delete still shows a banner that stays until dismissed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings on the logging commit:
- The notify decision line said "live list" or "cached list" by
repeating the lookup. The lookup now reports which list answered,
so the line cannot drift from it.
- Reading the app version at startup can throw. It now logs the error
and keeps "unknown" instead of failing startup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exported log could not show what the client did when a channel's
phone notify mode was set, or why a channel message notified, so #1121
could not be diagnosed from a log.
- Every notify-mode save logs radio, slot, channel, a one-way PSK
fingerprint, old mode with its source, new mode, and the read-back.
A save refused for a missing radio key or PSK logs as an error.
- Any change to the notify table, by any path, logs before and after.
Settings that fail to parse at startup, or fail to write, log errors.
- The notify dialog and the channel action sheet log what they show.
- Every incoming channel message logs its notify decision: which
channel the slot held, from the live or cached list, the mode and
where it came from, and posted or suppressed with the reason.
- NotificationService queue, batch, suppress and failure paths go to
the app log instead of debugPrint.
- The app version is logged at startup and on every connect.
- appLogger no longer drops messages when the in-app log view is off;
the log file always receives them, as connector lines already did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gemini review of #1117, findings verified against the code and firmware.
Kept:
- planChannelRestore was tested only through the connector. There are now
11 direct tests: Public to slot 0, nothing else there, a live channel
never overwritten, a channel already on the radio left out, erased slots
cleared first, no slot used twice, no key written twice, erased and empty
cache entries never written, and no-room channels reported.
- Removed a Public-first sort that guarded nothing: nothing but Public is
ever placed in slot 0, so the order cannot matter (a mutation dropping
it passed every test, which is how it showed).
Justified, not changed:
- "A second add right after Public displaces slot 0 uses a stale list":
the re-read starts synchronously in the write's finally, before the write
returns, so the table stays busy and the add gets the busy message.
- "Public is refused on new firmware when slot 0 is occupied": unreachable
there. Public can't be deleted, and boot puts a missing Public into the
first empty slot. So Public missing with slot 0 occupied happens only on a
full table, where nothing has room. On older firmware the fallback keeps
slot 0's channel from being overwritten.
- "Restoring Public over an erased slot 0 overwrites a recoverable record":
erased flash holds nothing. A cached channel from slot 0 is re-homed
elsewhere, not lost.
Full suite 2045 pass, analyze clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore to radio (#1060) replayed each cached channel into its remembered
slot, in place, and reported how many frames it sent. On the firmware
shipping next that is refused for every erased slot (an erased record
reads as occupied, #1865), for slot 0 unless it is Public, and for Public
anywhere else (#1896). It would still have said it restored them.
planChannelRestore (lib/helpers/channel_restore_plan.dart) now places by
identity:
- a cached channel whose key is already live on the radio is left out
- Public goes to slot 0
- any other channel goes to its remembered slot when that slot is free or
erased and not slot 0, otherwise to the lowest free slot
- a live channel is never a destination, so nothing is overwritten
- an erased slot is cleared before it is written
Every write goes through _writeChannelSlot and waits for the radio's OK or
ERR. The result is what the radio confirmed. The screen says "The radio
confirmed all N channel(s)", or "confirmed X of Y. Not restored: ...",
persistently. Waiting for each answer also paces the writes by the radio
itself, which replaces the fixed 10 ms gap. The comment claiming a confirmed
count was impossible is gone. The confirm dialog lists only the channels the
radio is missing, and no longer warns that it replaces what the slots hold,
because it doesn't.
The #1060 restore tests are rewritten to the new contract, keeping what they
protected (no erased entry written back, nothing cached is refused, the key
travels with the channel, writes are paced), and adding: slot 0 for Public
only, clear-before-write, nothing live rewritten or overwritten, refusals
reported by name.
Mutation-checked with this commit and the previous one: not skipping slot
0 fails 5 tests; never clearing first fails 1; counting sends as confirmed
fails 1; allowing a Public delete fails 2; a one-# hashtag rule fails 1.
Full suite 2034 pass, analyze clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The firmware shipping next (firmware-base, #1896) refuses any channel but
Public in slot 0, even while it is empty, refuses Public in any other slot,
and refuses clearing Public. Every refusal is ERR_CODE_BAD_STATE, the same
code as an occupied slot, so the client has to avoid them, not interpret
them. Owner rulings, 2026-10-28: slot 0 "should always remain public",
"make sure Public can't be deleted", "Of course add the real public".
- decideChannelSlot takes a required isPublic. Public goes to slot 0 when
it is free; nothing else ever does. The fallback that lets Public take
another free slot is reached only when slot 0 holds some other channel,
which happens only on older firmware.
- The shared allocator takes the key being written and decides from it,
so Join Public, a typed private key, a QR share and a hashtag join all
follow the rule, and a second Public is refused on every one of them.
- planChannelImport follows the same rule for a stock config file.
- Deleting Public is refused at the attempt with "Public can't be removed
from the radio. It always stays in slot 0." The control stays live.
- Edit Channel locks Public's key, and refuses typing Public's key into
another channel while Public is on the radio.
- A hashtag join of "public" (leading # and spaces and trailing spaces
dropped, any case: the device's namesPublic rule) adds the real Public,
not sha256("#public").
The #1022 test that asserted Public has no claim on slot 0 is replaced by
tests for the rule above.
On older firmware, slot 0 is no longer handed to other channels, so one
slot of 40 goes unused there. That follows the owner's ruling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second Gemini round on Epic #1021, findings verified against the code.
Kept, fixed:
- A writer's re-read called _syncChannels directly, so with two writes
overlapping, the first to finish started a sync while the second still
waited on the same reply queue. The trigger was restoreChannelsToRadio,
the one write path the UI did not gate. Writers now only request the
re-read; the last write to finish runs it, once. Nested writes (an edit's
clear and add) and batches re-read once, at the end.
- Restore to radio refuses with the busy message while the table is busy,
like every other channel write. With that, no write path can overlap a
sync.
Justified, not changed:
- "A write slips in between a batch ending and its deferred sync
starting": calling an async function runs synchronously up to its first
await, and _syncChannels sets _isSyncingChannels before any await, so no
tap can land in between.
- "A disconnect leaves the write counter stuck": every write decrements in
finally, and _writeChannelSlot returns within the 5 s reply timeout even
after the queue is cleared. A sync deferred meanwhile runs when that write
ends.
- "A deferred sync is dropped if a sync is already running": reachable only
when a write overlaps a running sync, which no write path allows now.
Mutation-checked: a writer starting its own re-read fails the new
overlapping-writes test. Full suite 1963 pass, analyze clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>