Repository navigation
fix(app): treat a missing pendant mute feature as legacy and retry a failed read - #26041
Merged
Merged
Conversation
…failed read setCaptureMuted threw 'Unable to confirm device mute capabilities' whenever the features read came back short. The native transport returns an empty read both for a characteristic the firmware lacks and for a failed read, so legacy pendants were refused and a read during a reconnect failed the pause. A discovered GATT table without the features characteristic is now the documented legacy no-op. Any other short read retries once before throwing. The quick action mute and unmute now report a failure as a non-fatal instead of leaving it uncaught.
kodjima33
marked this pull request as ready for review
November 22, 2026 12:28
Collaborator
Author
|
Merged after an independent review (SHIP, no must-fixes). Two things are still open for the BLE owners, @apoorvdarshan @Git-on-my-level:
If either shows a problem, revert 7da518a. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Crashlytics issue faed8329 is the #2 iOS issue this week: 159 users in 7 days (52, 49 and 35 a day on Nov 20 to 22), on 1.0.592 to 1.0.596. Crashlytics counts it as NON_FATAL, but every event carries
error_origin = uncaught_async, so it reaches the global uncaught handler instead of a handled pause failure. Source: Crashlytics BigQuery (com_friend_app_with_wearable_ios12_IOS_REALTIME),runs/2026-11-22/analysis/voice.md.Verified cause, from the stack traces (266 events, 7 days, one shape):
setCaptureMuted(omi_connection.dart:1364) throws whenever the features read is shorter than 4 bytes.NativeBleTransport.readCharacteristic(native_ble_transport.dart:315) returns[]for a characteristic missing from the GATT table, for a 10 s timeout and for any platform error. So the app cannot tell old firmware (where the doc comment promises a no-op) from a failed read.pauseCapture(),resumeCapture()andstreamDeviceRecording()rethrow it viathrowIfFailed()with the original stack. Any caller that does not await and catch turns it intouncaught_async.quick_actions_service.dart:206-208is one such caller.Change
No UI change. No change to the BLE protocol, UUIDs, firmware expectations, or connection and reconnect logic.
omi_connection.dartsetCaptureMuted: if the native transport has a discovered GATT table and the features characteristic is not in it, return as the documented legacy no-op. Otherwise a short or failed features read waits 500 ms and retries once, then throws as before. "Not discovered yet" is never treated as legacy: that would report a pause the pendant never applied.native_ble_transport.dart: read-onlyservicesDiscoveredgetter (no behavior change).quick_actions_service.dart: the mute and unmute shortcuts catch a failure and report it withreportNonFatalandcapture_mute_source=quick_action,capture_mute_action=mute|unmute.UI state after a failed write: the coordinator fails closed, so capture state stays as it was. The live page, Home card and device settings show "Something went wrong" (unchanged). The quick action has no screen, so a failed shortcut pause shows nothing to the user; its shortcut label follows the unchanged capture state. Not redesigned here.
Impact estimate
If the missing feature is a no-op and a failed read retries once, faed8329 non-fatal users go 159/week → near 0 (range 0 to ~80, MODELED). Churn effect unmeasured.
runs/2026-11-22/raw/crashes.json.Evidence
No visible change, so no screenshots. A simulator has no pendant. Unit tests with fake transports:
The first, third, fourth and fifth tests fail on main (run with hook-free copies of the tests against main's
lib/).BLE review needed
This touches
app/lib/services/devices/**(CODEOWNERS: @mdmohsin7). Recent authors of that folder (30 days): @Git-on-my-level (9), @apoorvdarshan (wrote the mute guard, f97e6bf), @deromka. Asking @apoorvdarshan and @Git-on-my-level to review, since the CODEOWNERS entry may be stale.Device tests needed (not run)
At ship
Product invariants affected
Tests
flutter test test/unit/omi_capture_mute_ble_test.dart test/services/quick_actions_service_test.dart test/unit/capture_policy_test.dart test/providers/capture_provider_test.dart test/unit/native_ble_transport_resync_test.dart test/services/devices/transports/native_ble_transport_test.dart: 167 passed.make preflight: passed. UX contract, UI isolate and brand checks are clean on the changed files.Not verified
DeviceProvider._onDeviceConnected(device_provider.dart:1129, avoid asyncthat awaitsstreamDeviceRecordingat 1190) and the Home post-frame callback (pages/home/page.dart:523-529). Catching there changes reconnect control flow, which this PR leaves alone. Those are follow-ups for the BLE owners.Failure-Class: FC-empty-ble-read-taken-as-capability
Line-Count-Exception: app/lib/services/devices/connectors/omi_connection.dart | 1580 -> 1604 | the legacy check and one retry belong next to the mute write they guard; splitting the connector is out of scope for a crash fix
UI-Evidence: none -- no visible change; quick_actions_service.dart only gains error handling (code and unit tests)