Skip to content

fix(app): don't flip a live pendant into Transcribe Later after closing the Device Tutorial - #20913

Merged
kodjima33 merged 1 commit into
mainfrom
issues-improver/20776-onboarding-batch-restore-guard
Oct 8, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
issues-improver/20776-onboarding-batch-restore-guard

Conversation

@kodjima33

@kodjima33 kodjima33 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

What

InteractiveDeviceOnboardingWrapper.dispose() always dispatches OnboardingBatchChanged(suspended: false) to restore batch mode when the pendant Device Tutorial closes, even when Transcribe Later was never suspended because it was off to begin with. The reducer (_reduceOnboardingBatch in app/lib/services/capture/capture_coordinator.dart) flipped the phase from pendantLive to pendantBatchLive on every such restore, regardless of whether anything had actually been suspended.

Fix: have the reducer read batchModeSuspendedForOnboarding from the environment (sampled fresh from _preferences on each dispatch) and leave the phase untouched when a restore event has nothing to restore.

Why (from the issue)

Opening and closing the pendant Device Tutorial (even closing the intro without starting) switches the capture coordinator from live pendant capture to the Transcribe Later phase, although Transcribe Later was never on. [...] The phone mic button refuses to record ("Stop Transcribe Later on your pendant first"), and live socket recovery for the pendant exits early.

The controller's own _restoreBatchAfterOnboardingBody() already no-ops correctly when nothing was suspended, but that didn't undo the reducer's unconditional phase flip — this PR closes that gap at the source.

What I tested

  • Added a regression episode to the existing table-driven capture_coordinator_test.dart suite: pendant connects live (Transcribe Later off) -> tutorial opens (suspended: true) -> tutorial closes (suspended: false) -> asserts phase stays pendantLive instead of flipping to pendantBatchLive.
  • Confirmed the new test fails against the pre-fix reducer (phase incorrectly became pendantBatchLive) and passes after the fix.
  • Ran the full capture_coordinator_test.dart suite: all 77 tests pass.
  • flutter analyze on the touched files shows only pre-existing, unrelated warnings (5 unawaited_return_in_try_block warnings ~250 lines away from this change).

fixes #20776

UI-Evidence: none -- pure state-machine/reducer logic fix (no screen, widget, or copy change)

Auto-generated from issue feedback by the mini issues-improver — tested and merged.

Line-Count-Exception: app/lib/services/capture/capture_coordinator.dart | 2932 -> 2943 | correctness fix requires reading env in the reducer plus a guard branch; no extraction attempted for an 11-line net change

Product invariants affected

  • INV-CAP-1

Failure-Class: none

View guided diff Turn on auto-fix

…ng the Device Tutorial

The onboarding wrapper's dispose() always dispatches OnboardingBatchChanged(suspended: false)
to restore batch mode, even when Transcribe Later was never suspended because it was off to
begin with. The reducer unconditionally flipped the phase to batch on that restore event,
leaving the capture coordinator out of sync with batchModeEnabled: the phone mic button then
refuses to record ("Stop Transcribe Later on your pendant first") and live pendant reconnect
stops working, until the app restarts.

Have _reduceOnboardingBatch read batchModeSuspendedForOnboarding from the environment and
leave the phase untouched on a restore that has nothing to restore.

fixes #20776
@kodjima33
kodjima33 merged commit 4f5e52b into main Oct 8, 2026
49 checks passed
@kodjima33
kodjima33 deleted the issues-improver/20776-onboarding-batch-restore-guard branch October 8, 2026 14:48
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.

Closing the Device Tutorial puts a live pendant into Transcribe Later state and blocks phone recording

1 participant