Skip to content

fix: preserve transcription through Wi-Fi and provider settings changes - #22197

Merged
kodjima33 merged 5 commits into
mainfrom
fix/20482-wifi-stt-recovery
Oct 20, 2026
Merged

kodjima33 merged 5 commits into
mainfrom
fix/20482-wifi-stt-recovery

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

A Wi-Fi probe could finish after a newer cellular result or interface loss and overwrite connectivity. Editing a Deepgram key could also retain the old generated Authorization header, while collapsing Advanced dropped customized request settings on save.

Keep reachability under one service-owned polling cadence with network/probe revisions and startup subscription ordering. Rotate only headers still bound to the previous generated credential, preserve explicit overrides and collapsed settings, include parser/audio-field edits in socket identity while preserving legacy IDs without overrides, and allow saving Omi/Parakeet when an inactive Whisper model is unavailable. Settings still dispatch the existing capture event; no recording, preference or account reset is introduced.

Refs #20482. The customer's exact network/provider cause and historical audio status are still unverified; this PR does not close the support case.

Validation:

  • Focused connection, credential, settings-widget and real capture/WAL retention regressions pass, including retained audio bytes and session identity.
  • Removing the fixes causes nine regression failures (two stale-probe cases, parser/audio-field identity, and five settings cases); fixed sources restored.
  • Analyzer ratchet, 24-check repository preflight, metadata validation and the normal pre-push gate pass.
  • Headless production Transcription settings rendering passes: app/scripts/visual_audit.sh --head WORKTREE --only settings-transcription (no physical-device claim).
  • All six seeded journeys pass (23/23 executed checks, no skips), with a source-bound receipt at the initial implementation commit.
  • Final compatibility adjustment: 31 focused connection/credential/settings/capture checks and all five paid-upgrade tests pass. Targeted analysis reports no issues. Legacy IDs are preserved when parser overrides are absent, so paid upgrades can release existing paywall pins.
  • Full app run completed with 6,326 passed, 16 skipped and one headless native-event-channel fixture failure. The fixture now explicitly stubs connectivity activation/cancellation; all 23 affected connectivity, probe and surface-disposal checks pass on rerun. Stream data errors are handled separately without treating them as evidence of being offline.
  • The final revision awaits full GitHub CI.
  • Physical CV1/iPhone Wi-Fi/cellular and handover testing remains required.

Release: merge and mobile store release required; no backend deployment. #21299 is already on main and its internet-detection improvement is listed in iOS 1.0.563 store notes. That release alone does not verify this customer's report. After a build containing this PR ships, verify short Wi-Fi/cellular clips and Offline Sync; privately collect versions and timestamps if failures continue. Keep apps installed and recording data intact.

Architecture and implementation/release checklist: app/docs/transcription-connectivity-recovery.md.

Failure-Class: FC-split-mutation-authority

Product invariants: INV-CAP-1 (retain pendant audio/session), INV-UI-1, INV-UI-3 (existing settings controls), INV-PERF-1 (no blocking UI work added).

UI-Evidence: none -- Behavior-only settings handlers; no layout, copy or styling changes. Production-widget interaction tests cover the saves; headless rendering is supplementary and does not replace physical network testing.

Line-Count-Exception: app/lib/pages/settings/transcription_settings_page.dart | 1572 -> 1583 | Keep the key-edit handler at its existing page owner; credential reconciliation is extracted into the shared model helper.

Merge with current main (f4ddf9c → this head)

Merged origin/main (a87589a, which includes #22088 and #22078) into the branch; no rebase, no force-push.

  • Conflict: app/lib/pages/settings/transcription_settings_page.dart imports. Both are kept: main's pages/on_device/on_device_settings_page.dart (used by its new OnDeviceSettingsEntry row) and this PR's models/stt_request_credentials.dart (updateSttRequestApiKey).
  • Rest of the file: I reviewed the auto-merged result against both sides. Main's other change there, removing the nativeEngineNoDownload help text and adding the on-device entry, sits beside this PR's credential, probe-fencing and Advanced-section code without overlap.

Verification on this head:

  • flutter test over usage_provider_paywall_pin_test.dart, test/services/capture/ (incl. transcription_settings_retention_test.dart), connectivity_service_test.dart, custom_stt_config_test.dart, stt_request_credentials_test.dart, surface_timer_after_dispose_test.dart, transcription_settings_recovery_test.dart and local_wal_sync_test.dart: 527 passed, 14 skipped, 0 failed.
  • flutter test over main's on-device settings renders (on_device_overflow_test.dart, on_device_copy_render_test.dart, storefront_l10n_render_test.dart): 183 passed.
  • flutter analyze on the four touched lib files: no issues. git diff --check origin/main...HEAD: clean.
  • The full bash test.sh app suite is left to CI on this head.

Still unverified: physical Wi-Fi ↔ cellular handover. No device was used, so live transcription and Offline Sync through real handovers have not been exercised. Keep the customer incident open.

@mintlify

mintlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Oct 20, 2026, 2:43 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: the core fixes here are correct and well-fenced — no blocking issues found. Positive signal from me; merge sign-off stays with a human maintainer.

What I verified:

  • app/lib/services/connectivity_service.dart — the interface subscription now starts before the initial checkConnectivity() snapshot, and the snapshot is discarded if _networkRevision moved while awaiting it. Stale probes can no longer overwrite newer state: _refreshInternet captures both the network and probe revisions and drops its result if either moved. Interface loss publishes offline immediately, and stream/probe errors degrade conservatively (log; probe failure counts as offline) rather than crashing or asserting online.
  • app/lib/models/stt_request_credentials.dart — updateSttRequestApiKey rotates only header entries whose value still equals the previously generated credential (matches the Token <key> defaults built in stt_provider.dart), case-insensitive on header name; deliberate overrides like a hand-written Authorization survive, and malformed JSON passes through untouched to existing validation. All covered by tests.
  • app/lib/models/custom_stt_config.dart — sttConfigId now includes audio_field_name/schema only when set, so configs without parser overrides keep their historical persisted IDs; the new paywall-pin test proves a legacy pin still releases on paid upgrade.
  • app/lib/pages/settings/transcription_settings_page.dart — request/schema JSON is parsed even when Advanced is collapsed, so customizations are no longer dropped on save, and the on-device Whisper model-presence check is gated by _useCustomStt, unblocking save of Omi/Parakeet when a stale Whisper selection has no local model.
  • Tests — the new connectivity, credential, settings-widget and capture/WAL retention tests are hermetic and exercise the races directly; the connectivity channel stub in surface_timer_after_dispose_test.dart is a legitimate harness addition, not production behavior.
  • Docs/changelog — the new app/docs/transcription-connectivity-recovery.md claims match the code (10s cadence, subscribe-before-snapshot, probe URLs unchanged); AppSetup.mdx commands are runnable; changelog fragment present.

Performance: reachability now runs on a service-owned 10s tick calling InternetConnection.hasInternetAccess while the checker instance keeps its own internal timer — worth confirming this doesn't roughly double probe traffic on device (2 URLs, 3s timeout each); negligible either way.

Security: no new data leaves the device; key rotation only rewrites locally stored request JSON.

USER IMPACT: Transcription keeps working through Wi-Fi-to-cellular switches, and updating a provider API key no longer wipes your custom request settings; saving provider changes also no longer fails just because an unused on-device Whisper model is missing.

Still wanted before merge: an on-device confirmation of a Wi-Fi-to-cellular handover during active transcription (the PR itself notes the customer case is unverified), and the probe-cadence check above.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Oct 18, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trusted backend/mobile fixer, well-documented connectivity/credential/settings regression fixes. mergeStateStatus is DIRTY (no rebase per standing policy) and diff (788 lines) exceeds the scoped-diff bar anyway — approve-only, needs author/bot rebase before it can land.

…covery

# Conflicts:
#	app/lib/pages/settings/transcription_settings_page.dart
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Pushed 1e48a7c (from f4ddf9c): merged current origin/main.

  • One conflict in transcription_settings_page.dart: kept both imports (stt_request_credentials.dart from this PR, on_device_settings_page.dart from main). Main's OnDeviceSettingsEntry and its help-text removal auto-merged.
  • Checked the merge result against git merge-tree; no other file differs.

Tests after the merge: connectivity, STT credentials, settings retention, capture/WAL and paid-upgrade suites, 527 passed / 14 skipped; on-device render suite 183 passed; analyzer clean; make preflight passed. The full app suite is left to CI.

Physical Wi‑Fi↔cellular handover is still unverified on a device.

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Auto-fix isn't included in your plan ↗

Upgrade to Team

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The production change here is correct and nicely scoped, and the recovery/retention tests are genuinely strong; one mechanical blocker from the main merge — the analyzer ratchet fails on one new unused import, so Dart Analyze & Tests and Mobile Release Eligibility are red on this head.

Blocking: Mobile App Checks run for 1e48a7c fails at the "Run analyzer ratchet" step with unused_import: 1 found, baseline 0; the Flutter test step was skipped after it, so tests haven't run on this head either. Your previous head f4ddf9c was green and main was green at the merge base — the stray import came in with the merge commit (transcription_settings_page.dart is the only app file whose merge result differs from both parents). Running flutter analyze in app/ will point at it; drop the import, or if it's deliberate follow the ratchet's own instruction (app/scripts/analyze_ratchet.sh --update-baseline in this PR).

What I verified on the new code:

  • app/lib/services/connectivity_service.dart: subscription-before-snapshot ordering in _initialize() plus the network/probe revision fence in _refreshInternet() correctly prevents a stale Wi-Fi probe from overwriting a newer cellular result; the @VisibleForTesting seams keep production behavior identical.
  • app/lib/models/stt_request_credentials.dart: updateSttRequestApiKey rotates only headers still equal to the previous generated value (case-insensitive name match), preserves explicit overrides, and passes malformed JSON through to existing validation — exactly the reported bug.
  • app/lib/models/custom_stt_config.dart: audio_field_name/schema join toJson only when set, so legacy sttConfigIds without overrides stay stable; the new legacy-identity test plus the paywall-pin release test in usage_provider_paywall_pin_test.dart cover the compatibility case.
  • app/lib/pages/settings/transcription_settings_page.dart: parsing request/schema JSON regardless of Advanced collapse, and the _useCustomStt guard on the on-device model check, fix both settings-loss paths from the PR description.
  • Tests: connectivity_service_test.dart (out-of-order probes, shared init), transcription_settings_recovery_test.dart (key rotation through the real widget), transcription_settings_retention_test.dart (session + durable audio survive a settings change via CaptureReplayWorld) — the right coverage for the bug class.
  • app/docs/transcription-connectivity-recovery.md, AppSetup.mdx, the CAPTURE_ARCHITECTURE.md cross-link and the changelog fragment all match the implementation.

Performance: the service now owns a 10s periodic reachability probe (2 URIs, 3s timeout) — same cadence the checker previously used, negligible change. Security: no new secret surfaces; tests use fixture keys only. Blast radius: transcription connectivity and STT settings saves for all app users; the retention tests cover the feared recording-loss path.

USER IMPACT: Transcription keeps working through Wi-Fi/cellular switches, and updating a provider API key no longer discards your custom request settings or blocks saving Omi/Parakeet.

Only remaining ask: green analyzer ratchet (and therefore green Mobile Release Eligibility) on the merged head — everything else looks ready.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@aryanorastar

aryanorastar commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Pushed dc5fcbc: merged current main (8edd56d). No code changes.

  • Why: Dart Analyze & Tests and Mobile Release Eligibility failed on the analyzer ratchet (unused_import: 1 found, baseline 0). With current main merged, app/scripts/analyze_ratchet.sh passes locally. I could not pin which file produced that one import: the previous head analyzes clean here, so the difference is probably in CI's generated code. Its source is unconfirmed, not shown to come from main.
  • Scope: the merge is clean, with no conflicts; the diff against main is exactly this PR's files.
  • Checks: this PR's tests, 42 passed.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reconfirming: connectivity/credential/settings fix is well-tested and CI is green on the current head (Dart Analyze & Tests, Mobile Release Eligibility both pass). Git-on-my-level's CHANGES_REQUESTED cited a specific analyzer failure on an earlier commit (1e48a7c) that is fixed on the current head (dc5fcbc) — stale, not applicable. kodjima33 already approved. 4/5 confidence (diff size is the only failing criterion).

@kodjima33
kodjima33 merged commit fbbec1d into main Oct 20, 2026
45 checks passed
@kodjima33
kodjima33 deleted the fix/20482-wifi-stt-recovery branch October 20, 2026 14:51
Git-on-my-level added a commit that referenced this pull request Oct 20, 2026
…#22873)

## Why

On 2026-10-20 a user lost about 4 hours of pendant audio, including a
2-hour conversation, and uploads stalled for the same 4 hours. A cold
start fixed both. Two investigations traced it to several gaps that
compound:

1. **Primary cause: a reconnect during a sync pass skipped capture, and
nothing restarted it.**
   - Every BLE connect wakes a `deviceConnected` pass.
- That pass ran inside `SyncWakeScope`, so
`DeviceProvider._onDeviceConnected` and `streamDeviceRecording` silently
skipped the capture start, and the uplink fence blocked socket and audio
opens.
- Nothing re-drove the skipped start when the pass ended or when the app
came to the foreground.
- The pass itself could hang forever on an untimed BLE read. Every later
wake (foreground, Retry) joined the stuck pass, so no uploads happened
either.
- A connected pendant on firmware 3.0.21 with no audio subscriber
**discards** audio (`transport.c` pusher, connected + unsubscribed
branch).
2. **Live socket recovery had dead ends.**
   - A normal server close (1000/1001) waited for the 15 s keep-alive.
   - The keep-alive cancels itself permanently on several conditions.
   - A network change or app resume never re-armed it.
3. **The upload worker only ran on wake events.**
- A wifi→cellular handover never reports offline, so it caused no wake.
   - Retries and the cooldown-end wake were dropped in the background.
   - Nothing woke the worker while rows sat in "Waiting to sync".
4. **BLE reads and writes had no timeouts.** On iOS, a second read of
the same characteristic overwrote the first caller's completion, so the
first caller's future never resolved.

## What changes

**1. Capture is never stranded by an upload pass.**
- Only the OS-granted `periodic` window (BGTask) still fences live
capture. Reconnect and watchdog passes no longer do
(`RecordingTransferCoordinator.fencesLiveCapture`).
- `DeviceProvider` always calls `streamDeviceRecording`.
- If a start lands inside a fenced pass, it is recorded and **replayed
when the fence drops**.
- Foreground resume starts a connected pendant that capture left idle.
- **Every pass has a hard time limit:** 60 min, or 10 min when fenced.
The limit sits inside the scope, so a hung stage releases the fence and
`_inFlight`. `SyncProvider` cancels the abandoned sync, and the
coordinator schedules a retry.

**2. Pendant audio is never silently dropped.**
- `NativeBleTransport` hands audio notifications that arrive with no
Dart listener to `OrphanAudioRoute`. These packets were previously
dropped by the broadcast controller, because the native GATT
subscription outlives capture's listener.
- Capture writes them synchronously to the existing safety WAL while the
WAL tracks the pendant codec. They then upload through the normal sync
path.
- **Why the WAL and not unsubscribing:** on shipped firmware,
unsubscribing while connected makes the pendant *discard* audio. It
writes flash only while disconnected
(`omi/firmware/omi/src/lib/core/transport.c` pusher). Unsubscribing is
therefore not a fallback.
- **Excluded:** muted policy (user intent), a caller stop (the
voice-profile flow), Transcribe Later (the native writer owns that
audio), and phone or call ownership.

**3. Live socket recovery.**
- A server close (except terminal codes 1008/4001/4002/4004/4005), a
socket error, connectivity restore, a network-type change and app resume
each kick an immediate reconnect.
- Backoff is bounded: 1, 2, 5, 10 and 15 s over a 5-minute window, with
the 15 s keep-alive still running underneath.
- The kick re-arms a keep-alive that had cancelled itself, and
re-installs a missing pendant audio stream while capture still owns it.

**4. Upload worker.**
- Any connectivity change wakes the worker, including a network-type
change (`ConnectivityService.onNetworkChange`).
- `cooldownElapsed` is accepted in the background. Retries also run in
the background, capped at 6 consecutive failures.
- A new `watchdog` wake runs every 10 minutes while recordings are
pending and no pass is running.
- The multipart upload response-body read now has a 2-minute timeout.

**5. BLE timeouts.**
- Dart `NativeBleTransport` read and write calls time out after 10 s. A
timed-out read returns empty; a timed-out write throws.
- Capture's codec read is bounded at 35 s and falls back to the last
known codec.
- **iOS** `OmiBleManager`: pending reads and writes are queued FIFO per
characteristic instead of overwritten, and each fails with `TIMEOUT`
after 10 s.

**6. Telemetry.**
- New registered event `Capture Recovery Observed`, with `kind`
(`capture_start_skipped`, `capture_start_redriven`,
`pendant_audio_orphaned`, `transfer_pass_timed_out`) and `trigger`, plus
a consumer question.
- Debug-log markers: `capture_start_skipped`,
`capture_stopped_with_device_streaming`, `transfer_pass_stuck`,
`ble_op_timeout`.

**Flags:** none. These restore intended behaviour and ship on by
default. Each new path is bounded (rate limits, retry cap, time limits)
and fails toward recording.

**Known trade-off:** on firmware that has opted into live persistence
(draft #20450, not released), orphan audio is also on the ring. The
pendant ring custody contract
(`app/lib/services/wals/PENDANT_RING_CUSTODY.md`) prefers keeping both
copies over losing one.

## Tests

Run as targeted Flutter tests under `nice -n 19`. Results:
- `test/services` + `test/providers`: 1638 passed.
- `test/spine` (`OMI_DEV_CONTROLS=1`): 138 passed.
- `test/unit` + `test/backend`: passed.

New tests:
- **`test/services/capture/capture_live_recovery_test.dart`**, through
the real controller, socket service and WAL with a scripted transport.
It covers:
  - a normal close reconnecting within 2 s;
  - repeated closes backing off but never stopping;
- a network handover, and separately an app resume, re-arming a
keep-alive that had cancelled itself;
  - terminal close codes not kicking a reconnect;
- **a reconnect during a fenced pass still yielding capture once the
pass ends**;
- **a hung fenced pass aborted by its time limit, after which capture
starts**;
  - reconnect passes not fencing at all;
- orphan packets being persisted, while muted and caller-stopped
pendants are left alone.
- **`recording_transfer_coordinator_test.dart`** covers:
- a hung pass being abandoned, releasing the fence and the joined wakes;
  - only `periodic` fencing;
  - a network handover waking a pass;
  - the watchdog waking only while work is pending;
  - background cooldown and bounded background retries.
- **`native_ble_transport_test.dart`** covers read and write timeouts
and orphan delivery.

Updated tests (these encoded the old contract):
- `periodic_recording_sync_test` now expects capture after the pass, and
bounded background retries.
- `tiered_capture_test` and `resume_sync_fence_test` now use the
`periodic` fence.
- `capture_recovery_replay_scenarios_test`: connectivity restore now
reconnects immediately rather than at the next 15 s tick.

**Not verified:** on-device behaviour (no physical pendant run), and the
iOS native change. The Swift change was syntax-checked with `swiftc
-parse` only and needs the iOS CI build.

## Regression guard for #20837

Fault-injection tests in
`app/test/services/capture/capture_live_recovery_test.dart`, group
"regression guard for #20837 (fault injection)". They run in CI through
`flutter test`.

**Each test asserts two things:**
- live capture (a connected socket plus the pendant audio subscription)
is running again within **3 s** of virtual time;
- **no pendant packet is dropped:** every packet emitted while the
pendant was connected is durable in the safety WAL.

**Faults covered:**
- **A Wi-Fi to cellular handover during an upload pass.** The socket
dies on the old interface, a network change follows, and the reconnect
pass is still running.
- **A normal server close (1000) of the live socket.**
- **A pendant BLE drop and reconnect in the middle of a fenced pass.**
Packets arriving while capture is deferred reach the orphan route and
are persisted, and capture starts when the fence drops.
- **A hung pass that never finishes.** The hard time limit ends it, and
capture starts.

By construction, each of these fails on the pre-PR code (reasoned from
the code paths; not executed against the old tree): either there is no
capture restart, or the restart comes at the 15 s keep-alive, beyond the
3 s bound.

## Review round 1 (Grok) fixes

- **FIX-FIRST, replay under phone or call ownership.** A start swallowed
by a fence is now replayed unless the pendant already owns capture, is
suspended, or was stopped by a caller. The reducer records the pendant
as suspended while a phone recording or call holds capture, and resumes
it afterwards. New test: "a start swallowed while a phone recording owns
capture resumes the pendant after it".
- **FIX-FIRST, orphan WAL priming race.**
- The codec boundary is taken only while the transport still has no
listener and no phone or call owns capture, and this is rechecked after
the await.
- No boundary is taken when the WAL already tracks the pendant codec
(new `LocalWalSyncImpl.currentCodec`).
- The backlog is written only while the WAL codec matches. Otherwise it
is dropped rather than written under the wrong codec.
  - A full backlog drops the oldest packet.
- **FIX-FIRST, an abandoned pass keeps running.**
- A timed-out pass is marked stale by a pass generation and stops at its
next stage boundary.
  - It holds an extra transfer keep-alive until it actually exits.
- No later pass discovers or drains beside it. That block is bounded by
a second time limit, after which the pass is presumed dead.
- The test now asserts that there is no second discovery or drain while
the body runs, and that the keep-alive is balanced.
- **SHOULD-FIX, iOS GATT queue.** Only the queue head is issued to
CoreBluetooth, which allows one outstanding read or write per
characteristic. The next request is issued when the head completes or
times out.
- **Not changed:**
- A timed-out Dart read still returns empty. That matches every other
native read failure, which also maps to empty, and the watchdog and
reconnect wakes retry.
- Only Opus goes to the safety WAL. That matches the primary capture
path's `checkWalSupported`.
- Fenced foreground periodic windows are capped at 10 min, as noted in
the review's NIT.
- **Merge with main:** the change is merged with main (#22197 rewrote
`ConnectivityService`). `onNetworkChange` is re-added on top of that
version and has a unit test.

## Review round 2 (Grok) fixes

- **FIX-FIRST, orphan priming race (supersedes the round-1 priming).**
- Orphan audio is now written synchronously, and only while the WAL
already tracks the pendant's codec. That holds in the incident shape,
where the pendant was the last source.
- The orphan path never calls `onAudioCodecChanged`, so it cannot race a
live start or wipe a session that subscribed in the meantime.
- When the codecs differ, packets are counted (`dropped`) and capture is
restarted.
- New test: "orphan packets never move the WAL off another source's
codec".
- **FIX-FIRST, gate on an abandoned pass.**
- An abandoned pass now blocks discovery and drain until it actually
exits. There is no time-based release any more.
- Its sync is cancelled on timeout, and every BLE and HTTP await beneath
it is now bounded, so it does exit.
- Every stage returns once the pass is stale. That includes the tail
after the drain (refresh and reconcile) and the `catch` path.
- **SHOULD-FIX, iOS late GATT replies.** After a timeout, the next
operation waits for CoreBluetooth's late reply, or a 5 s grace, before
it is issued. The late reply is never handed to the next waiter.

## Review round 3 (Grok): mergeable

- Grok's verdict: every FIX-FIRST from rounds 1 and 2 is resolved.
- **SHOULD-FIX taken:** a deferred start that is swallowed again by a
periodic fence raised in the same turn now re-arms and loops, instead of
being stranded.
- **Not taken in this PR (follow-ups):**
- correlate a late iOS GATT reply by operation id on notifying
characteristics;
- make a timed-out Dart read throw instead of returning empty, so a
storage list read that times out is retried rather than counted as "no
files".

## Product invariants affected

- INV-CAP-1: this extends it. A sync pass, a dead socket or a missing
listener must not stop consumption of pendant audio while the connected
firmware discards unconsumed frames.

UI-Evidence: none -- no UI change; capture, sync and BLE plumbing only

Failure-Class: FC-automatic-capture-pause-without-retention

Line-Count-Exception: app/lib/services/capture/capture_controller.dart |
4520 -> 4531 | recovery hooks only (part directive, state field,
resume/close/connectivity/stop hooks, sync dispose cancel); logic lives
in the new capture_live_recovery.dart part
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2757
-> 2758 | one read-only currentCodec getter so orphan audio never forces
a codec boundary on a WAL that already tracks the pendant codec

🤖 Generated with [Claude Code](https://claude.com/claude-code)

This branch was successfully deployed

1 active deployment
staging - docs — dc5fcbca Deployed Oct 20, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants