Registry Mirror
Skip to content

Conversation

@Lemelson

@Lemelson Lemelson commented Nov 30, 2026 •

Copy link
Copy Markdown

Fixes #45859

When Android reports that the app moved to the background during active dictation, finish the recording and put the transcript in the original editable draft. The mobile caller chooses the policy and the controller handles the transition. This keeps preparation cancellation and the existing iOS interruption behavior.

Verification

  • The controller regression covers a live transcript that becomes available when capture stops, a single draft insert and cleanup, and the existing interruption message when the recording is discarded.
  • 104 targeted tests and check:changed passed.
  • The issue was reproduced using Home on a Pixel 9 emulator (see fix(mobile): dictation keeps the recorded take when the app goes to the background #45948). The revised patch has not been tested on a device with the original timer. A native recorder or transcription error can still discard the take.

Implemented with GPT-6.2 Sol in Codex. The revised approach was reviewed by GPT-6.2 Sol (Medium).

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 30, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at c7f1950

Macroscope's review found this PR approvable — Android dictation now stops and preserves its transcript when the app backgrounds instead of discarding it. The change reuses existing transcription, draft-validation, and resource-cleanup behavior.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mobile provider now selects a finish or discard policy when the app moves to the background. The voice input controller applies that policy during recording. Tests cover both outcomes.

Changes: Background recording policy

Layer / File(s) Summary
Apply and test background recording policies
packages/client-runtime/src/voice-input/controller.ts, apps/mobile/src/features/voice-input/VoiceInputProvider.tsx, packages/client-runtime/src/voice-input/controller.test.ts
The controller now requires a "finish" or "discard" policy. During recording, "finish" stops and finishes the recording; the existing interruption path handles other cases. The provider selects "finish" on Android and "discard" on other platforms. Tests cover commit, interruption error, recording deletion, and preparation cancellation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 2b936

On Android, backgrounding the app during dictation now finishes the recording and appends the transcript to the draft instead of discarding it. Other platforms keep their current discard behavior. No concrete merge-blocking risk was found; device validation is still pending.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: on Android, dictation is preserved when the app moves to the background. The changeset passes an activeRecording policy ("finish" on Android) to appMovedToBackground, …
Linked Issues check Passed [#45859] The issue requires that dictation already recorded before an external interruption is kept, becomes editable text in the same composer, keeps existing draft text, and waits for the user to se…
Out of Scope Changes check Passed All changes connect to the #45859 fix. The VoiceInputProvider.tsx change selects the Android policy at the background callback. The controller.ts change adds the activeRecording policy parameter…
Description check Passed The description follows most of the template. It has a clear problem link (Fixes #45859) and a Change explanation that covers the Android background policy, the controller handoff, and the preserved p…
Full details: Title check

Explanation

The title names the main change: on Android, dictation is preserved when the app moves to the background. The changeset passes an activeRecording policy ("finish" on Android) to appMovedToBackground, and the PR objectives describe the same outcome. The title follows conventional commit form and is specific enough for a teammate scanning history.

Full details: Linked Issues check

Explanation

[#45859] The issue requires that dictation already recorded before an external interruption is kept, becomes editable text in the same composer, keeps existing draft text, and waits for the user to send. The reviewed head changes VoiceInputProvider.tsx so that Android passes "finish" to appMovedToBackground. The controller change in controller.ts calls this.stop() when the policy is "finish" and state.phase === "recording". The existing Stop path then transcribes the take and commits the text to the original draft. The PR does not change the send behavior, so the user still sends manually. The regression test in controller.test.ts covers the "finish" and "discard" policies and checks the commit and error results. Two limits remain. First, the change applies to Android only, which matches the issue area. Second, device validation is pending, so the exact timer-triggered lifecycle event is not confirmed on a phone. The recorder-error path and the recording-time limit (#42754) are not changed. The issue names these as separate concerns, so their absence does not fail this requirement.

Full details: Out of Scope Changes check

Explanation

All changes connect to the #45859 fix. The VoiceInputProvider.tsx change selects the Android policy at the background callback. The controller.ts change adds the activeRecording policy parameter and the finish branch. The controller.test.ts changes add tests for both policies and pass "finish" in the existing preparation-cancellation test. The summary also reports a Platform.OS mock and a shared mock recorder helper in VoiceInputProvider.test.ts. These support the new Android branch tests. The PR does not change the recorder-error path or the recording-limit logic. No unrelated feature or refactor appears in the reviewed changes. One unverified point: the appMovedToBackground signature now requires an argument. This review did not search for other call sites, so type-check coverage of those call sites is not confirmed by this assessment.

Full details: Description check

Explanation

The description follows most of the template. It has a clear problem link (Fixes #45859) and a Change explanation that covers the Android background policy, the controller handoff, and the preserved preparation cancellation and iOS interruption behavior. It also has a Verification section with specific tests and a device reproduction note. Two parts are weak. The Scope section does not state the bug is a bug, and the issue link is present but the section heading is absent. The Problem section is missing: the description does not state the expected behavior in its own heading, only implies it through the Change text. The model/harness line is present. Overall the description is mostly complete, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c7f1950 and 2b9368a.

Files selected for processing: 3

  • apps/mobile/src/features/voice-input/VoiceInputProvider.tsx
  • packages/client-runtime/src/voice-input/controller.test.ts
  • packages/client-runtime/src/voice-input/controller.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Android discards the entire dictation when a timer interrupts recording

1 participant