Skip to content

revert(app): remove the automatic phone-mic fallback on BLE disconnect - #11134

Merged
mdmohsin7 merged 1 commit into
mainfrom
revert/phone-fallback-on-ble-disconnect
Aug 5, 2026
Merged

mdmohsin7 merged 1 commit into
mainfrom
revert/phone-fallback-on-ble-disconnect

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Reverts #11084 (75e4e1789d), which added CaptureController.onRecordingDeviceDisconnected() and the DeviceProvider hook that starts a phone-mic batch recording whenever the wearable disconnects mid-session.

Why

This behaviour was already reviewed and rejected. #11066 proposed the same phone-side fallback and received CHANGES_REQUESTED from the app maintainer:

The tagged issue actually means recording on the device offline when not connected to bluetooth. Right now it does record offline but it breaks sometimes. This PR is not the right fix for this

#11066 was closed, and #11078 was opened specifically so a phone-side fallback could be scoped on its own merits. #11078 is still open and unapproved.

The PR description did not match its diff. #11084 is titled "preserve on-device offline batch across BLE disconnect" and its body states it "prevents the phone-mic fallback from triggering". Before #11084 there was no such fallback to prevent: onRecordingDeviceDisconnected did not exist and nothing called it, and _startPhoneMicBatch was reachable only from user-initiated paths. The PR introduced the feature together with a guard for it; the Implementation section listed neither the new method nor the device_provider.dart call site.

The guard does not cover Omi hardware. It reads:

final bool isOnDeviceOfflineBatchActive = SharedPreferencesUtil().batchModeEnabled &&
    _recordingDevice != null &&
    (_recordingDevice!.type == DeviceType.limitless || _offlineSessionStartSeconds != 0);

It consults batchModeEnabled, but ring-buffer capture is keyed on firmware (WalSyncs.isRingBufferFirmware, 3.0.20+) and is independent of that pref. With batch mode off, an Omi on 3.0.20+ keeps writing to its on-device ring while the phone starts its own mic batch — the same interval is captured twice and syncs as duplicate conversations, plus an unrequested mic activation and the battery cost.

#11084 did address the technical review notes from #11066 (deviceRecord state, awaited stop hand-off, deviceSupportsTranscribeLater). The product objection was not addressed.

Scope

Revert only. #11064 and #11085 from the same batch are left in place — #11064 is a genuine sort fix, and #11085 needs a real fix rather than a revert (its filterFullySyncedConversations never releases a WAL retired to WalStatus.outsideRecoveryWindow by #10995, so those conversations stay filtered out of the synced list; tracked separately).

#7194 remains open on its actual subject: on-device offline recording that works but is flaky across disconnects.

Verification

flutter analyze lib/services/capture/capture_controller.dart lib/utils/batch_recording.dart \
  lib/providers/device_provider.dart test/unit/batch_recording_phone_test.dart
  -> 1 info (unnecessary_import at device_provider.dart:4), confirmed pre-existing on main; 0 new

flutter test test/unit/batch_recording_phone_test.dart test/providers/capture_provider_test.dart \
  test/providers/sync_provider_fully_synced_conversations_test.dart \
  test/unit/synced_conversation_pointer_order_test.dart
  -> 89 tests, all passed

grep shouldFallbackToPhoneOnDeviceDisconnect | onRecordingDeviceDisconnected |
     isRecordingDuringDeviceDisconnect | _phoneMicBatchStopCompleter
  -> no matches remain under app/

make preflight -> 11 checks passed

Clean revert: no later commit touched capture_controller.dart, batch_recording.dart, device_provider.dart, or batch_recording_phone_test.dart between #11084 and 84e4c1828b.

Product invariants affected

none

Failure class (fixes)

No fix: commits; no declaration required.

Review in cubic

Reverts 75e4e17 (#11084), which added `onRecordingDeviceDisconnected()`
and the `device_provider` hook that starts a phone-mic batch recording
whenever the wearable drops mid-session.

The same behaviour was proposed in #11066 and rejected by the app
maintainer: #7194 asks for on-device offline recording to keep working
across a disconnect, not for the phone to start recording in its place.
#11066 was closed and #11078 was opened to scope a phone-side fallback on
its own merits; #11078 is still open and unapproved.

#11084 landed the feature anyway, described as a guard against it. Its
guard is also wrong for Omi hardware: it consults `batchModeEnabled`, but
ring-buffer capture is keyed on firmware (`isRingBufferFirmware`, 3.0.20+)
and is independent of that pref. With batch mode off, an Omi on 3.0.20+
keeps writing to its ring while the phone starts its own mic batch, so the
same interval is captured twice and syncs as duplicate conversations.

Verification:
  flutter analyze lib/services/capture/capture_controller.dart \
    lib/utils/batch_recording.dart lib/providers/device_provider.dart \
    test/unit/batch_recording_phone_test.dart
    -> 1 pre-existing info (unnecessary_import, already on main), 0 new
  flutter test test/unit/batch_recording_phone_test.dart \
    test/providers/capture_provider_test.dart \
    test/providers/sync_provider_fully_synced_conversations_test.dart \
    test/unit/synced_conversation_pointer_order_test.dart
    -> 89 tests, all passed
  grep for shouldFallbackToPhoneOnDeviceDisconnect / onRecordingDeviceDisconnected
  / isRecordingDuringDeviceDisconnect / _phoneMicBatchStopCompleter -> no matches

Failure-Class: none
@mdmohsin7
mdmohsin7 merged commit 1bbf050 into main Aug 5, 2026
31 checks passed
@mdmohsin7
mdmohsin7 deleted the revert/phone-fallback-on-ble-disconnect branch August 5, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant