Repository navigation
fix(mobile): iOS dictation keeps recording when you lock the phone or switch apps - #1
Open
fishdogdev wants to merge 1 commit into
Open
fishdogdev wants to merge 1 commit into
fishdogdev wants to merge 1 commit into
Conversation
…s to the background Locking the phone or switching apps while dictating treated the recording as an interruption: the captured audio was deleted and the composer showed "Voice recording was interrupted." with nothing to retry from. Natively, expo-audio also paused the recorder on background because the recording audio mode never allowed background recording. iOS now sets allowsBackgroundRecording for recording sessions and leaves a running recording alone when the app goes to the background; returning with a recorder the system paused (call, Siri) finishes and transcribes it. Android, which cannot record in the background without a microphone foreground service, stops and transcribes what was captured instead of discarding it. Preparation is still cancelled on background, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
fishdogdev
force-pushed
the
fix/ios-background-dictation
branch
from
November 12, 2026 04:09
92470b2 to
6295dde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approval:
On iPhone, locking the phone or switching apps mid-dictation throws away everything recorded so far. expo-audio pauses the recorder as soon as the app leaves the foreground,
VoiceInputController.appMovedToBackgroundthen treats the dictation as interrupted and deletes the file, and the user comes back to "Voice recording was interrupted." with a Retry that starts from nothing. Glancing at another app or the phone locking itself is the usual way this happens.Fix
allowsBackgroundRecording, andappMovedToBackground({ keepRecording: true })leaves a running recording alone. Coming back and pressing the check mark inserts the whole transcript.UIBackgroundModes: ["audio"](used today for picture in picture) and the microphone permission. There is no new entitlement, permission, Info.plist key, setting, or native rebuild.docs/user/composer.mddescribes both platforms.Scope
This is the narrow part of
#10140. That PR added an app-scoped recording session that followed the user across drafts and threads, and its review asked for approval of the background-recording direction and scope. This PR has no app-scoped session and does not touch drafts, threads, or navigation; it only stops an in-progress dictation from being thrown away when the app leaves the foreground. It does keep the microphone on after leaving the app for that dictation, and approval for exactly that scope is linked above. Idea:#25019(converted from#24927).Verification
packages/client-runtime:vp test run src/voice-input/controller.test.ts. The new case fails onmain(expected 'error' to be 'recording') and passes here; the existing preparation case still passes.apps/mobile:vp test run src/features/voice-input/voiceInputSession.test.ts src/features/voice-input/voiceRecordingPermission.test.tscovers the call/Siri recovery and that Android's permission dialog neither interrupts nor resumes dictation.vp run check:changedpasses.main): "Voice recording was interrupted." and nothing is inserted.mainthe recording is discarded with no transcription request. Here it is finished and sent for transcription (POST /api/voice/transcribe, 200) and dictation returns to idle with no error. The emulator microphone is silent, so this shows the stop-and-transcribe path, not transcript text.Written with Claude Opus 5.5 in Claude Code; reviewed with Claude Fable 5.1 in Claude Code.
🤖 Generated with Claude Code