Repository navigation
Restore saved pendant connections during native iOS launch - #26085
Git-on-my-level merged 3 commits into
Conversation
Failure-Class: FC-saved-device-launch-failure-revokes-reconnect
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab77a4bd0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| !OmiSavedReconnectIntent().saved.isEmpty { | ||
| _ = OmiBleManager.shared |
There was a problem hiding this comment.
Preserve capture before connecting pendants headlessly
When iOS cold-launches a background task with a saved legacy live-mode pendant but no Flutter scene or restored audio subscription, this now actively connects it through centralManagerDidUpdateState. In a fresh process, captureReconnects is empty and flutterApi is nil, so completeDeviceReady (OmiBleManager.swift:631-648) never subscribes to audio; native batch writing cannot help without notifications either. The legacy pendant then discards audio while connected/unsubscribed instead of retaining it offline, as documented in app/lib/services/capture/CAPTURE_POLICY.md:121-128, causing silent recording loss until Dart starts and violating INV-CAP-1. Establish a native durable consumer or verify device-side retention before allowing this saved-target headless connection.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c6535d93e793ae6ba7161c948543512646f5f94a. Native startup still restores the central and records lifecycle diagnostics. A saved legacy pendant now stays disconnected until Dart explicitly manages it. The restore and connect callbacks cancel inherited links without capture custody, including pending connections that complete during cancellation. A saved Limitless pendant in Transcribe Later remains eligible for a fresh headless reconnect via the matching native flash drain. Its pages stay on the pendant until the native writer has fsynced them.
The Swift callback harness, 52 focused Dart tests, local preflight, and unsigned iOS dev build passed. The PR checklist now calls for playback of the legacy headless interval on internal TestFlight.
Failure-Class: FC-saved-device-launch-failure-revokes-reconnect
Defer legacy BLE connections until Dart manages the target. Cancel inherited links before they can hold a pendant in live mode, and allow a fresh headless connection for the native Limitless flash-drain route. Failure-Class: FC-saved-device-launch-failure-revokes-reconnect Co-Authored-By: Codex <[email protected]>
Summary
omi_ble_native_restore_enabledto false to disable early central initialization and the new lifecycle diagnostics. The custody gate is deliberately not behind this switch: with the switch off, a saved legacy pendant still waits for Dart to manage the device before connecting (it is never connected without an audio consumer). Only Limitless flash drain in Transcribe Later reconnects natively.Incident
A native restore launch could bypass the Flutter scene that previously registered the singleton. The incident logs stop during a reconnect attempt and resume at a user launch, so they do not establish whether this defect caused the 21-hour gap. Existing saved-target callbacks submit OS-owned requests and leave them pending; app timers still matter when a peripheral cannot be retrieved and scan retries are paused between windows. Apple's TN3115 describes relaunch conditions and exceptions.
Verification
omi-heavyand producedRunner.app. Local preflight passed all 42 checks.Release and David must complete this device checklist on internal TestFlight before any external release:
restore_launchappears in the debug log.omi_ble_native_restore_enabled=falseand confirm early central init and lifecycle diagnostics are off, and that a saved pendant reconnects once the app is foregrounded (custody gate stays on).Product invariants affected
Failure-Class: FC-saved-device-launch-failure-revokes-reconnect
UI-Evidence: none -- Native reconnect and debug diagnostics only.