The android job in release-signed.yml now attests app-release.aab with
actions/attest-build-provenance, after the certificate check. The
publish workflow sends only a bundle this record vouches for: built by
release-signed.yml, at this tag's commit, on a GitHub-hosted runner.
The job gains id-token: write and attestations: write for that step,
and restates contents: read because job permissions replace the
workflow's. Google refuses this job's token: the A2 condition requires
the play-release environment and play-publish.yml.
Tests: test_workflows.py checks the step names the AAB and the job
holds the permissions. Pointing the step at the APK fails the test.
Agent: JadeEagle (session e9df9ed6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision 2026-11-23 (option 2), after replaying three merged PRs
through check 2: a fix whose tests only call its new API (#1131) and a
new feature whose test imports a new file (#1130) were both blocked,
because a test that cannot compile against the base never ran there.
- For a PR titled feat, a changed test file that cannot compile against
the base counts in check 2. A new capability has no old behavior to
fail. The pass message warns that a fix must not use this rule.
- Every other type stays strict: a fix needs a test that fails on the
base code itself.
- The self-check now also checks the feat reading, so a runner format
change cannot break the feat rule quietly.
- A pass message lists any changed test files that did not compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every fix and every new capability is meant to ship with a regression
test, and nothing enforced it: a PR could change lib/ with no test, or
add a test that passes on the old code too. The rule held only while an
agent remembered it.
- Check 1: a change to lib/ (translations excepted) needs an added or
changed *_test.dart. A deleted test does not count.
- Check 2: CI puts back the base branch's lib/, regenerates code, and
runs only the changed test files. At least one real test must fail or
throw there. A file that does not compile against the base, a failing
setUpAll hook, a skipped test, or a run that never finished proves
nothing and does not count.
- Exempt only by PR type (refactor, chore, ci, build, docs, style,
test), printed in the job summary. No skip label or flag (#927).
- Paths are read NUL-separated (git diff -z, xargs -0), so a space,
tab, newline or quote in a name cannot hide a file or split it.
- A self-check runs known fixtures through the real runner before
check 2, so a Flutter change to the JSON format fails the gate
instead of quietly passing it.
- Logic lives in tool/test_gate.dart with 35 unit tests. Each guard was
shown failing against a deliberately broken copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A2's condition admits only play-publish.yml at a v* tag, and every v*
tag is a real release, so A3 couldn't start with a read-only dispatch
from GitHub. Revised with the owner's go on 2026-11-23:
- Play side: tracks listed as play-publisher via a temporary
impersonation grant, removed afterwards and confirmed refused.
- Throwaway branch: Google refused a sign-in from outside play-release
by its attribute condition, GitHub refused a branch job asking for
play-release, and a build record verified at its own ref while a
wrong ref, a wrong signer workflow and an unrecorded file failed.
The section 7 table records what is settled. The first successful
GitHub sign-in stays with B3's first publish.
Agent: JadeEagle (session e9df9ed6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision 2026-11-21 on #1053: each release starts on the track he
picks (Internal, External or production) and promotes onward from
Internal or External, any step skippable. A promotion moves the same
bundle and uses no new version code. Test builds still never upload.
Tool: an `internal` target alongside `external` (Play's `alpha`) and
`production`. Internal and External go to their whole tester list, so
both take draft or 100 only.
Tests: Internal publishes to the internal track, refuses a percentage,
and an unknown target names all three. Promotion through all three
tracks, and Internal straight to production, each upload once. 37 pass.
With Internal removed from the whole-list rule, the percentage test
fails.
Plan: decision 3, the cut table, the up-front notes, A1, A2, B1, B3,
section 6 and Done when are revised to three targets.
Agent: JadeEagle (session e9df9ed6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/play/play_release.py sends a signed release bundle to Play's closed
testing track (External) or production through the Android Publisher edits
API. A read-only tracks command lists every track for A3.
Before any change it checks the bundle certificate against the
release-signed.yml pin, the bundle version code against the tag's pubspec,
the tag against the pubspec version, the notes length, and that the code is
higher than anything Play holds unless Play already holds this exact bundle.
It never removes another release, stops on a different version mid rollout,
on a narrowing request and on a release shared with another version, and a
re-run at the same rollout changes nothing. A failed run deletes its edit.
32 tests, run in the analyze check. Each of 17 guards was removed in turn and
every removal failed a test. The parser reads codes 66, 67 and 68 and the
pinned certificate from the three real release bundles.
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>
scripts/ is in this repo's .gitignore, so the payload script never
reached the commit and the workflow would have called a missing file.
The four payload fields now go straight to gh api as typed fields,
with no checkout and no script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A push to dev that touches docs/user sends an app-docs repository
dispatch to offband-site, which rebuilds and publishes
docs.offband.org/app/ (offband-site#77). This mirrors the firmware
repo's docs-notify sender: same payload shape, PROJECT_PAT, no
workflow_dispatch so a branch's copy of the file never runs with the
token. The site validates the payload and builds the current dev head.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner review of the first pages:
- List the App Store app for iPhone (iOS 16.4 or newer).
- Give the Bluetooth pairing PIN: radios with a screen show a new one
each start, radios without one (T1000-E, a QCC badge without a
display) use 123456, and a PIN set in the app replaces either.
Checked against the companion firmware's startup code.
- Shrink the screenshots to 360 px wide. At full phone resolution each
one filled several screens; the site has no image sizing, so the
files themselves are sized to read at phone scale (24 MB to 4.8 MB).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A start page, nine task guides and a gallery of every screen, in
docs/user for docs.offband.org/app/ (publishing is offband-site#77).
Behavior described in the guides was checked against the app's code
and strings. A strict MkDocs build with the site's theme settings
passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 screens from Offband MeshCore 1.8.0 on Android with the USA radio
presets, named by the screen they show, under docs/user/assets/android
to mirror the firmware manual's layout.
Personal details are blurred: message text, contact names that carry
FCC call signs or a street address, the radio's coordinates (including
the GPS reply shown as hex in the companion log), and a name on the
line-of-sight map.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Version bump to 1.8.0+69 and the owner-approved release texts:
CHANGELOG [1.8.0], release-notes/1.8.0.md (the GitHub release body),
play/1.8.0.txt (441/500), discord/1.8.0.md, and announcements/1.8.0.md
for the GitHub Discussions Announcements category, with a README for the
new folder.
Every known issue that ships is listed: #1121, #1123, #1132, #1124,
#1028 and #1134, plus #1066 in the CHANGELOG.
Release tracker #1136, part of epic #312.
Agent: JadeEagle (session e9df9ed6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gemini review finding: a missing key in Apple's response crashed the poll
with a bare KeyError. It now fails with the submission id and the start
of the response body.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run 42718673916 proved the lane end to end on this branch: Apple
accepted the submission, the staple validated, and spctl reported
"source=Notarized Developer ID". The lane now runs only when
release-signed.yml calls it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hold of a few hours now finishes on its own instead of needing a
manual re-run. The Linux runner costs nothing on a public repo, and the
release does not wait on it. A hold past the limit still fails red and
is finished by "Re-run failed jobs" with no rebuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split the macOS lane into three jobs. A Mac job builds, signs and submits
without waiting. A Linux job polls Apple for that submission, 45 minutes
at most. A short Mac job staples the ticket and verifies. If Apple holds
the submission longer, the signed app stays an artifact for 30 days and
"Re-run failed jobs" checks the same submission again, with no rebuild.
The release no longer needs macOS. Android, Windows and Linux publish on
their own; macos-attach adds the notarized zip once Apple accepts it.
The lane moves to its own apple-macos Environment and its own notary key
(MACOS_NOTARY_*), sharing nothing with the iOS lane in apple-signing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first submission for the new Developer ID was still In Progress at Apple
when the 30-minute wait ran out, failing a run whose signing had passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New reusable macos-signed.yml, gated by the apple-signing Environment:
imports the Developer ID Application identity into a temporary keychain,
builds, signs every nested Mach-O and framework then the app with Hardened
Runtime and its entitlements, notarizes with notarytool using the existing
App Store Connect API key, staples, and checks the result with spctl before
zipping. release-signed.yml's macos job now calls it, so an unsigned or
unnotarized macOS app can never be published.
A temporary push trigger on this branch proves the lane before a tag; it is
removed before merge.
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>
Gemini review findings on Epic #1021, after verifying each against the
code.
Kept, fixed:
- A sync started while a channel write waits for its reply shares the
ordered reply queue with it, so the sync's empty-slot ERR could be taken
as the write's answer. The trigger is real even though the review named a
path that doesn't exist: pull-to-refresh, the sync button, the 400 ms
channel-changed debounce, and dev's 3 s failed-sync retry all call
getChannels at any time. getChannels now defers while a write is in
flight, and the last write to finish runs it once. The writers' own
re-reads call _syncChannels directly.
- Config import and community delete hold the guard across their whole
loop (batchChannelWrites), so a deferred sync cannot start between two
writes.
- A key change whose clear lands but whose add fails used to report "did
not confirm the change", understating that the channel is now gone. It
returns ChannelWrite.clearedNotAdded, with a message saying the slot is
empty and to add the channel again.
Justified, not changed:
- A reply arriving after the 5 s timeout, once the waiter has been
dropped, shifts the queue by one. Keeping the waiter instead would shift
it permanently whenever a reply is truly lost. Firmware answers
CMD_SET_CHANNEL synchronously, far inside 5 s, and a disconnect clears the
queue, so dropping is the smaller risk.
- Claimed crash on removeAt(0) with an empty queue: both handlers check
isEmpty first.
Mutation-checked: removing the deferral fails 2 tests; returning the add's
own result fails 1. Full suite 1962 pass, analyze clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebasing Epic #1021 onto dev met #1063, which keys channel history by the
channel's PSK. On a slot reassignment it keeps the old channel's history,
so re-adding that channel brings it back, and only a delete removes history
outright. #1026's write path had cleared history on every change; the
rebase resolution moves it onto dev's rules. A confirmed reassignment
(an add, or an edit to a new key) purges only the slot's legacy keys and
the in-memory entry. A confirmed delete removes history outright. All three
still happen only after the radio's OK.
Nothing in dev's suite caught a reassignment true-deleting the old
channel's history: with that mutation applied, all tests passed. A new test
(channel_write_history_identity_test.dart) drives the real PSK-keyed store
and fails 2 of 4 under it.
The Edit Channel dialog now checks for a busy channel table before #1103's
identity check. Mid-sync the list is empty, so the identity check closed the
dialog and blamed a changed channel. The busy check keeps the dialog and the
user's edits open and gives the real reason.
#1060's restoreChannelsToRadio now counts as a channel write in flight
while it runs, so an add made during a restore is refused instead of
choosing a slot the restore is about to fill (in the rebased #1026 commit).
Full suite 1954 + 4 pass, analyze clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part A of the #1021 test child.
Widget tests (test/helpers/channel_slot_ui_test.dart) for all six refusal
messages: busy, all slots full (with the count), Public already on the
radio, and the three unconfirmed-write outcomes (occupied, rejected, no
reply). Each one shows on its own failure, is still on screen 10 seconds
later (past the 4 second toast default), and none shows when the action is
allowed.
Connector test: a channel sync that fails restores the cached list with
hasLoadedChannels false, and the table still reads as not busy, so an add
gets a free slot. This is the lockout a hasLoadedChannels gate would have
caused on a flaky link, driven through the real sync rather than asserted.
The "Public is already on this radio" check moves from the channels screen
into channel_slot_ui.dart, so all six messages live in one tested place.
Mutation-checked: dropping persist: true fails all 7 persistence tests;
gating the table on hasLoadedChannels fails the failed-sync test. Full suite
1805 pass, analyze clean.
Part B (on-device) is the owner's hardware pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setChannel sent CMD_SET_CHANNEL and moved on without the radio's OK or
ERR, then cleared the slot's message history on the strength of having
sent it. Firmware with OffbandMesh/meshcore-firmware#1864 refuses a
different channel over an occupied slot with ERR_CODE_BAD_STATE and keeps
that channel intact, so the client would have deleted the history of a
channel the radio still holds.
Connector:
- setChannel, deleteChannel and the new editChannel wait for the reply,
using the existing generic-ack queue (each pending entry can now carry a
completer), and return ChannelWrite: ok, occupied (BAD_STATE), rejected,
or noReply (timeout, send failure, or not connected).
- History is cleared only after an OK. A refusal or no reply keeps it.
- A timed-out waiter leaves the queue, so a late or lost reply cannot be
matched to the next command.
- isChannelTableBusy covers an unanswered write as well as a sync. Without
that, a second add made while the first is waiting would pick the same
slot, because the list does not show the first one yet.
- editChannel does clear-then-add for a new key. #1864 firmware refuses a
new key written in place (owner ruling on that epic: changing a key is
clear-then-add), so the edit dialog would have broken once it shipped.
A rename is still a single write.
Callers:
- Every add, edit and delete path waits for the result and shows its
success toast only after an OK; otherwise a persistent message says what
happened. The two places the channels screen cleared history itself now
do it only after an OK.
- Edit and delete refuse, with the busy message, while the table is busy.
- Config import and community delete write one channel at a time and
re-read the list once at the end. A re-read after each write would put
the next write inside a sync, where its reply cannot be told from the
sync's. Import counts only confirmed channels; refused ones are listed
as skipped.
- Creating a community: the dialog closes before the write, so the wait
cannot invite a second tap, and a refused channel's message is no longer
replaced by the "created" toast (a #1022 regression, since a newer toast
replaces the visible one).
Tests: 12 connector tests driving synthetic OK / BAD_STATE / NOT_FOUND /
no reply. Mutation-checked: clearing before the reply fails 3, a new key
written in place fails 1, and a timed-out waiter left queued fails 1. Full
suite 1793 pass, analyze clean.
The refusal path cannot be exercised on a real radio until #1864 ships;
the OK path can be tested on hardware now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>