- Message notifications use Android MessagingStyle with Reply, Mark as read,
and Mute channel actions, so they work in Android Auto and on watches
- Replies go through the normal send path (length limits, SMAZ, Cyr2Lat,
retries), split into up to 3 messages, and report failures
- Declare Android Auto notification support and register the action receiver
- Add a bell icon to channel chat to mute/unmute; unify the channel mute key
so unnamed channels mute correctly
- Update README and docs for Android Auto support
dispose() no longer relies on FlSerial.closePort() to free the I/O buffers:
it checks the buffers' first byte instead of their address, so it usually
leaked both. Close via fl_close and always free by address.
A native close still running in a helper isolate is invisible to a fresh
isolate after hot restart, so connect() could fl_free() a slot mid-close.
Track the in-flight close with a per-process temp marker and wait for it
(bounded to 45s) before resetting the slot table.
- Updated LoRa airtime calculations in `lora_airtime_test.dart` to reflect new reference values.
- Introduced new tests for LDRO behavior and preamble symbol calculations.
- Added `contact_path_width_test.dart` to validate path hash width handling in contacts.
- Enhanced `model_changes_test.dart` to ensure legacy data migration works correctly.
- Created `remote_node_stats_test.dart` to decode and validate remote node statistics.
- Implemented `map_marker_parse_test.dart` for parsing marker text with coordinate validation.
- Developed `map_tile_cache_key_test.dart` to ensure API keys are excluded from cache keys.
- Added `message_retry_failure_test.dart` to test message retry service behavior on failures.
- Extended `path_history_service_test.dart` to preserve learned state across path attempts.
- Enhanced `received_image_store_test.dart` to handle concurrent writes and review fixes.
- Implemented `repeater_command_service_test.dart` to validate command response handling.
- Created `store_tolerant_parsing_test.dart` to ensure stores skip malformed records gracefully.
- Cleared untranslated JSON file for localization updates.
Sixth review round:
- disconnect(manual: true) joining an in-flight automatic teardown now
still marks it manual (and cancels the reconnect timer / stops the
background service), so a user-initiated disconnect can no longer be
followed by an auto-reconnect scheduled by the teardown it joined.
- _shouldAutoReconnect is false once _disposed, so a teardown that
outlives disposal cannot arm a timer that calls connect() on a disposed
connector.
- connect()/connectUsb()/connectTcp() and UsbSerialService.connect()
re-check the connection state after awaiting the in-flight teardown.
The await is a suspension point, so two callers could previously pass
the initial guard, resume together and both run the open sequence.
Fifth review round:
- MeshCoreConnector.dispose() sets _disposed, and _setState(),
notifyListeners() and markNotifyDirty() no-op afterwards. A teardown
started before disposal can still be running (the USB native close waits
out the kernel's closing_wait off the UI isolate), and its tail would
otherwise call notifyListeners() on a disposed ChangeNotifier.
- _handleSerialData() now only drops callbacks in the teardown states
(disconnecting/disconnected) instead of everything that is not
`connected`, so data arriving in the `connecting` window is still
ingested and buffered by the frame decoder.
Fourth review round:
- UsbSerialService.connect() now waits for _activeDisconnect before it
claims the `connecting` status, covering the Android USB-host path too;
previously the wait sat inside the desktop branch, so an Android
reconnect could still be overwritten by the old teardown.
- MeshCoreConnector.disconnect() is now a re-entrant-safe wrapper around
_disconnectInternal() that publishes the teardown as _activeDisconnect,
and connect()/connectUsb()/connectTcp() join it before starting. The
transport-level guard alone could not prevent the connector's own
teardown tail from setting the state back to `disconnected` after a new
connection was up. Repeat disconnect() calls now join the in-flight
teardown instead of returning early while it is still running.
flutter analyze clean; flutter test 570 passing, 2 pre-existing failures
in message_url_image_helper_test.dart (identical on a stashed tree);
flutter build linux --debug succeeds.
Third review round:
- disconnect() is now a re-entrant-safe wrapper around _disconnectInternal()
whose future is held in _activeDisconnect for the entire teardown, not just
the native close. connect() and dispose() wait on that instead of
_pendingNativeClose, so a reconnect can no longer open a new port and then
have the tail of the old teardown mark it disconnected.
- dispose() closes on any live handle (flh >= 0) instead of only when
isOpen() reports `open`: flserial keeps a valid slot and a running
SerialThread in the I/O error state, which would otherwise have been
orphaned. A setDTR() failure no longer skips the close.
- _releaseSerialBuffers() takes alreadyFreed: closePort() frees both buffers
but leaves the pointer fields dangling, so after a successful synchronous
close the fields are only cleared, never freed a second time.
Builds: flutter build linux --debug succeeds (after patching the unrelated
glibc >= 2.42 / tinycthread once_flag clash in the flserial checkout).
Second review round:
- connect() awaits _pendingNativeClose before touching flserial's global
slot table. fl_close() (helper isolate) and fl_free()/fl_init() mutate
the same flserial_tab, so reconnecting during the kernel's closing_wait
could double-close the old slot or kill the freshly opened one.
- dispose() no longer re-enters disconnect() when a close is in flight;
the running disconnect owns the ordering (native close, then
subscription cancel), so dispose only chains _closeFrameController onto
the pending close.
- dispose() frees the I/O buffers through the new _releaseSerialBuffers()
on every path, not just after a successful closePort(); with _serial
nulled, an error/closed-state dispose used to leak both 8 KiB buffers.
- _handleSerialData() ignores callbacks once the status leaves `connected`:
a callback queued before flh was invalidated made readList() throw and
published a spurious transport error mid-teardown.
Review follow-up:
- dispose() now takes ownership of the FlSerial (nulls _serial) and clears
serialReadBuff/serialWriteBuff after the synchronous closePort(); flserial
frees those buffers but leaves the pointer fields dangling, so a later
disconnect() reaching _closePortOffUiIsolate() with the same object would
have freed them a second time. _closePortOffUiIsolate() additionally
returns early when flh is already -1.
- dispose() skips its synchronous close when a close is already in flight:
fl_close() sets breakThread and joins the SerialThread before it reaches
the blocking ::close(), so the thread — and its NativeCallable — is
already gone while the helper isolate waits out closing_wait. The
in-flight future is tracked in _pendingNativeClose.
- If Isolate.run itself fails the port is now closed inline rather than
leaking a native slot and SerialThread with no reachable handle.
close(2) on a tty whose output the peer never drained blocks in the
kernel for the line discipline's closing_wait (measured 30.4s on Linux
against a CDC-ACM device that never reads its bulk OUT endpoint, e.g. a
MeshCore board flashed with a BLE-only companion build). FlSerial's
closePort() is a synchronous FFI call, so the whole app froze for that
window on every failed USB connect and on disconnect.
fl_close() only touches process-global native state, so run it through
Isolate.run() and replicate the Dart-side cleanup closePort() does
(stream close, calloc'd I/O buffers, flh reset). Log when the close
exceeds 1s so the "device is not draining" case is visible in the debug
log.
Verified against the wedged device: inline close blocked the calling
isolate for 30476ms with 0 timer ticks; the isolate close took 30302ms
with 302 ticks, i.e. the main isolate stayed responsive throughout.
Companion firmware (MeshCore commit 4a869163, 2025-12-30) replaces the
CLI frame timestamp with the companion node's RTC for TXT_TYPE_CLI_DATA,
so "clock sync" sets the repeater clock to the node RTC. Nodes with a
wrong RTC push repeater clocks years into the future; firmware cannot
set the clock backwards without clkreboot.
- RepeaterCommandService: translate "clock sync" to "time <phone epoch>"
before sending, matching official meshcore-cli behavior
- repeater login dialog: send "time <epoch>" for auto clock sync after
login (this path bypasses RepeaterCommandService)
- add unit tests for the command translation
Ref: https://github.com/zjs81/meshcore-open/issues/464
- Added new localization strings for Swedish, Ukrainian, and Chinese languages in app_sv.arb, app_uk.arb, and app_zh.arb respectively.
- Enhanced the path map UI in channel_message_path_screen.dart for better readability and interaction.
- Improved message retry logic in message_retry_service.dart to prevent double-pumping of queues.
- Bumped version number in pubspec.yaml to 9.5.0+13.
- Cleared untranslated strings in untranslated.json to reflect current localization status.
- Improved formatting of ListTile icons and text styles in settings_screen.dart, telemetry_screen.dart, usb_screen.dart, gif_picker.dart, path_editor_sheet.dart, repeater_login_dialog.dart, and room_login_dialog.dart for better readability.
- Consolidated TextStyle definitions into single lines where applicable.
- Updated notification_service.dart to enhance readability of notification ID assignment.
- Simplified function signatures in routing_sheet.dart for clarity.
- Cleaned up test assertions in usb_flow_test.dart for conciseness.
- Removed unused translations in untranslated.json to streamline localization files.
- Implemented contactTypeIcon and contactTypeColor functions for better UI representation of contact types.
- Created colorForName and firstCharacterOrEmoji functions to enhance contact display.
- Developed PathEditorSheet widget for managing contact paths with a user-friendly interface.
- Introduced RoutingSheet for managing contact routing modes and displaying path history.
- Added a script for generating proof of concept (PoC) payloads for clipboard contact import validation.