Owner direction 2026-10-02: emulate stock and Offband separately; the
firmware publishes a protocol manifest at every tag and merge
(OffbandMesh/meshcore-firmware#1318) and the fake radio consumes it;
client CI checks its constants against the manifest; real-radio
traces (Offband, and one radio flashed to stock by the owner) check
behavior at D1. 55 points, still four Epics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Dart fake companion radio, in-process and over TCP, so CI can test
connect, sync, messaging and preset flows (including remote nodes)
with no hardware. Four Epics: core and handshake (#756), messaging,
settings, remote nodes and faults (#757), CI suites and a manual
runner (#758), integration testing (#759). Gemini 2.5 review: three
findings, all verified and folded in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the Custom Name override epic and the documentation of what a display name does not prove. Owner approved the plan in chat before this PR was opened, per the review-then-approval-then-execution order in SAFELANE section 3.
Architecture: Contact.name becomes a getter returning customName ?? receivedName, and the constructor takes receivedName. Measured 85 display reads against 22 writes, so renaming the write parameter makes the compiler enumerate every write site while every read stays correct and untouched. The rejected alternative, adding displayName and migrating 85 reads, fails silently when a site is missed.
The field is receivedName rather than advertName because a contact-card name is not advertised. Writing the test matrix caught that; the original naming would have lied for every card-added contact.
One hole the type system cannot see: the five buildUpdateContactPathFrame call sites read .name and would still compile, which would write a private label into the radio's shared contact table. Test T14 reads the source and guards it.
31 automated tests, every behaviour with a positive and a negative. Nine assert absence and exist purely to fail on a future regression.
Adversarially reviewed with Gemini 2.5 Pro. One finding accepted: nothing proved the UI never writes an empty custom name, so T29 and T30 were added. One finding rejected with a citation: the claimed migration crash does not exist because contact_store.dart line 145 already reads json name as String with a fallback to Unknown. Its narrower grain, that the rename could drop that fallback, became T31.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
OUTCOMES.md records what was delivered, the owner's D1 approval, the
evidence, what went wrong and what's left. PLAN.md gains section 10:
Epic A merged before D1 (the plan's gap), and the #748 tests.
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>
fl_open started SerialThread and only then called mtx_init. Upstream's
thread locked a mutex only after its first read returned data, so the gap
rarely mattered; #710's room check locks inFifo_mutex on the thread's
first pass, which made the race reachable on every connect.
The mutexes are now initialised right after the FlSerial is allocated,
before open() can throw, so _fl_close_slot also never destroys an
uninitialised mutex after a failed open. Both copies stay identical.
Found by the pre-PR Gemini review.
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>
flserial's reader thread copied every byte into an 8 KB ring that
overwrote the oldest bytes when full, and told Dart about data only
once the port went idle. The RK4 sends its 350-contact list (about
52 KB) in about 0.17 s, so most of it was overwritten before the app
read it: the app saw 106-154 contacts and #660's contacts were lost.
The thread now reads only as much as the ring has room for. When the
ring is full it leaves the bytes in the OS driver, and USB flow control
holds the radio, so nothing is dropped. The ring is 256 KB (the size
the header already declared as MAX_PORT_FIFO_LEN, and a power of two
as the ring's mask needs); the per-read chunk stays 8 KB on the thread
stack. Dart is called back during a burst (4 KB waiting or 10 ms) and
whenever the ring fills, not only when the port goes idle.
Same change in the macOS copy of the source (macos/Classes), which was
identical. (std::min) is parenthesised because the Windows headers
define a min macro.
Verified on the owner's RK4 (read-only harness driving the DLL):
new DLL 350/350 in every mode, including a reader 2 s late, zero bytes
skipped; the old DLL, as the control, got 345 app-like and 54 (8191
bytes, the old ring's capacity) when 300 ms or 2 s late.
Epic #702.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whitespace only, from dart format, so CI's repo-wide format check
passes. Same step #696 took for the vendored Android BLE plugin.
Epic #702.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pristine import of MeshEnvy/flserial at
48216310061efc8d5d217cc18014fc2cb501646e (MIT, Grzegorz Lesniak), the
exact commit the app already pinned, into packages/flserial, with the
dependency switched from git to a path. Mirrors the #695/#686 vendor
pattern.
Vendored with git itself (fetch of that commit, read-tree --prefix), so
every file is the upstream blob: all 70 files verified blob-for-blob
against the commit. Left out, as #695 did: example/, .github/ and
.vscode/.
No behaviour change. The Windows release build compiles the plugin from
the vendored path and produces a flserial.dll of the same size as the
installed one. pubspec.lock also picks up flutter_blue_plus_android
8.2.2+offband.1, the version dev's own vendored package already
declares.
The fix for the 8 KB ring that overwrote contact-sync bytes (#704)
follows in #710.
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>
Sensor contacts gain a "Manage Sensor" item that opens the repeater
login and admin hub. Stock sensor firmware handles the same admin login
(SensorMesh::handleLoginReq) and CLI-over-mesh as repeaters, so the
remote settings screen, its preset picker and tempradio option work
there too. Repeater and room server menus are unchanged.
Epic: #733
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>
The About card gains a credit line under the existing MeshCore Open
attribution, and the licenses page gains a "MeshCore suggested radio
presets" entry naming Liam Cottle, api.meshcore.nz, MeshCore and the
config-profiles mirror, alongside the Open-Meteo entry.
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>
Gemini recheck: a hardcoded 260px ceiling ellipsizes prematurely when a
large accessibility font is set, even on a wide screen, and looks oddly
constrained on desktop. Now 70% of viewport width, which keeps the
overflow bound on a narrow phone and gives room where there is room.
Co-Authored-By: Claude Opus 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>
The receive half of contact sharing. Until now an incoming
<key:type:name> rendered as raw text while the stock app showed a native
Add Contact button for the identical payload, so sharing worked outbound
only: a stock user could add an Offband user from a card, but not the
reverse. Confirmed by the owner on hardware.
Reuses the proven mention-chip mechanism in TranslatedMessageContent
rather than adding new machinery. Both patterns are now collected and
sorted by position, so a message carrying a mention AND a card renders
both in the right order; they cannot overlap, since a mention is @[...]
and a card is <...>.
Tapping opens the add dialog seeded with the card rather than adding
silently. A contact is an identity, so adding one stays a deliberate act
with the key, name and type visible first.
Two deliberate refusals:
- A card whose key is already a contact renders inert, mirroring stock,
which warned the owner rather than silently re-adding.
- A card matching the shape but failing the parser, such as an
out-of-range type, falls back to plain text. Showing an Add chip there
would promise something the parser will refuse.
Parsing already existed from the #611 Gemini review, so this change is
rendering and dedupe only.
Epic #610 under Feature #609.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three writers copied raw UTF-8 bytes up to a 31-byte boundary with no
codepoint check, so any name crossing it was cut mid-character and
invalid UTF-8 reached the radio. It was then stored that way and handed
back to every client that later read the contact or channel. ASCII names
were unaffected, which is why it went unnoticed.
An 11-character Chinese or Japanese name is 33 bytes against a 31-byte
budget, so it corrupted every time.
Adds utf8TruncateToBytes, which stops on a GRAPHEME CLUSTER boundary.
Codepoint-safe is not sufficient: a ZWJ emoji sequence is several
codepoints joined by U+200D plus a variation selector, so a
codepoint-safe cut can still leave a bare glyph, a dangling joiner or an
orphaned selector. The characters package was already a dependency, and
flutter/widgets re-exports it, so this costs nothing new.
Fixed at all three sites:
- writeCString, used for contact names and channel names
- buildSetAdvertNameFrame, which sets THIS device's own advert name
That last one mattered most: it is the name the whole mesh sees, the
name embedded in the contact cards this device emits, and what other
clients match against. Corrupt it once and it propagates outward.
The strongest test sweeps every budget from 0 upward across a string
mixing 1, 3 and 4-byte characters and asserts the output always decodes
strictly as UTF-8, which is precisely the property that was broken. ASCII
output is unchanged.
Found by the standards#145 Gemini review on the #619 branch, which was
told not to re-report writeCString and located the third site instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sensor admin path is in scope (C5). Hardware testing happens once at
the end, in Epic D; the chain does not stop between Epics.
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MESH 500 regional preset system: Liam's public preset list as the
base, an Offband overlay in config-profiles that wins on conflict, a
catalog in the app that works offline and refreshes without a release,
and applying presets to every node type with stock firmware commands.
Four Epics (A config-profiles, B app catalog + Companion/Observer,
C remote nodes, D integration testing) with grant terms for running
B, C and D as a chain, merges deferred to the end.
Feature: #647
Agent: MagentaHawk (session 5a8922d6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gemini gate found a real defect that would have shipped: the Linux MTU stream
would have attached to nothing and reported an MTU for a device never.
`devicesChanged` fires only on deviceAdded / deviceRemoved. At the moment a
device is added BlueZ has not finished service discovery, so `gattServices` is
still empty; this plugin waits on `while (!device.servicesResolved)` elsewhere
for exactly that reason. The original patch built its per-characteristic
subscriptions inside that one event, found no characteristics, and had nothing
to re-trigger it when discovery later completed. Verified in the vendored
source, not taken on the reviewer's word.
Now nested: for each device, rebuild the characteristic subscriptions on every
`device.propertiesChanged`, which includes ServicesResolved flipping true. Same
shape the plugin's own `_initFlutterBluePlus` already uses for its logging, so
this is the file's existing idiom rather than a new one.
Also emits once per rebuild (`startWith(device)`), so an MTU already negotiated
before we were listening is reported rather than waiting on a change that may
never arrive. Safe when unknown: 0 is filtered downstream.
Two other findings reviewed and accepted as clean, recorded so they are not
re-litigated: "max across characteristics" is right because the ATT MTU is
per-connection, not per-characteristic; and the web exemption is sound because
the browser owns fragmentation and 172 is far inside the spec's 512-byte
writeValue limit.
analyze clean, format clean, 981 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
One getter decides the composer's byte budget on every platform, and it had
collapsed that budget to zero on three of them before anyone noticed: Windows
(#686), Linux (#717) and Web (#718). Each surfaced as a user reporting "the
keyboard doesn't respond", two months and three platforms apart. Nothing
exercised the getter, so nothing went red.
Extracts the decision into `MeshCoreConnector.resolveFrameBudget`, a pure
function of (transport, isWeb, mtuNow). The getter is now a one-line delegate
and behaves identically. This is what makes the web branch testable at all:
`kIsWeb` is a compile-time constant, so a VM test could never enter it and CI
runs the suite on the VM only.
19 new cases, covering what we now know rather than what we guessed:
- wired transports are never floored, and ignore a bogus MTU
- web is exempt from the floor, and both composers stay usable at MTU 23
- native BLE keeps the #395 write-safety floor: unknown MTU yields 20, never
the full frame, because defaulting an unknown link to the largest size would
authorize an oversized write
- the MTUs actually measured on hardware (Android 247, Windows 176) leave a
usable channel composer
- the original failure stays reproducible: an unreported MTU still gives a
0-byte channel budget and 4 bytes for a DM, the two numbers users reported
Also adds widget tests for the #684 notice, including the disconnect case the
pre-PR review caught, and the severity split between a zero and a small budget.
analyze clean, 981 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Upstream flutter_blue_plus_linux returns `Stream.empty()` from onMtuChanged,
so no MTU ever reaches Dart on Linux. FlutterBluePlus._mtuValues stays empty,
mtuNow falls back to its 23-byte ATT default forever, effectiveMaxFrameSize
returns the 20-byte floor, and maxChannelMessageBytes clamps to 0. Every
keystroke is then rejected by the length limiter while the field still focuses
and blinks: the #592 symptom, reported on Linux as locked entry fields.
BlueZ does expose the negotiated MTU, as a property on
org.bluez.GattCharacteristic1, surfaced by the bluez package this plugin
already depends on (BlueZGattCharacteristic.mtu). The value was one layer down
the whole time and simply never read.
The patch watches characteristic property changes for 'MTU' and emits a
BmMtuChangedResponse carrying the largest value across the device's
characteristics. They describe one ATT link so they should agree; the max
stops a characteristic that has not been exercised yet, and so reports
nothing, from dragging the figure down. Zero is filtered out, because
FlutterBluePlus would cache it and hand callers something worse than its own
default, and identical consecutive values are suppressed.
Nothing downstream needed changing: the device.mtu subscription added for
Windows in #686 is platform-agnostic, so Linux now gets the same live budget
recovery through the same path.
Also points dependency_overrides at the vendored copy. Third vendored BLE
backend, alongside android (#694) and winrt (#686).
Verified: analyze clean, format clean, 962 tests pass. NOT verified on Linux
hardware; nobody here runs Linux BLE, which is why the gap survived this long.
#717's acceptance requires a real Linux BLE connect showing a non-default
`MTU now:` in the app log.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI runs `dart format --output=none --set-exit-if-changed .` across the whole
repo, vendored packages included, so the upstream file's own formatting fails
the analyze check. Third time: #694 hit it on the Android plugin (b33e8485,
chore(#696)) and #686 on the WinRT one.
Formatting only, kept separate so the MTU patch that follows is reviewable
instead of buried in reflowed lines. Re-vendoring upstream later means
re-running dart format on this file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pristine import of pub.dev flutter_blue_plus_linux-8.2.2 into packages/,
mirroring the WinRT vendor from #686 and the Android vendor from #695. The
patch rides on top as its own commit so the upstream baseline stays diffable.
Verified against the pub cache with `diff -r --strip-trailing-cr`: all 8 files
identical. FlutterBluePlus License v1.4 and the BSD NOTICE retained unchanged.
No wiring yet: dependency_overrides is not pointed at this copy until the patch
lands, so this commit is inert.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Web Bluetooth exposes no ATT MTU to page script; there is no API for it, so
`mtuNow` can only ever be the 23-byte default. `effectiveMaxFrameSize` applied
the BLE floor on every platform whenever the transport was bluetooth, so web
landed on 20 bytes permanently and the channel composer computed a 0-byte
limit. That is the #592 symptom on a third platform.
Unlike Windows (#686) and Linux (#717), this cannot be fixed by reporting an
MTU, because there is none to report. Patching flutter_blue_plus_web would
achieve nothing.
The floor exists because a raw single characteristic write larger than the PDU
is rejected and wedges the send path (#395). That failure mode is not reachable
on web: the browser owns fragmentation, and the Web Bluetooth spec caps one
write at 512 bytes, rejecting anything larger with InvalidModificationError.
maxFrameSize (172) is well inside that, so a write cannot be oversized whatever
the link negotiated. Cited rather than assumed, because "just remove the floor"
was considered and rejected as the fix for #592.
Not unit-testable: `kIsWeb` is a compile-time constant, so a VM test cannot
enter this branch and CI runs the suite on the VM only. The floor's behaviour
on the other platforms stays covered. Proving this one needs a max-length send
over web BLE in a browser, which is the acceptance criterion on #718.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The four new ARB keys are English-only, so they land in the untranslated report
for the other 17 locales (68 entries). Generated file, no behaviour change;
committed so it does not read as stale against app_en.arb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>