Skip to content

fix(voice): recover from recorder startup and runtime failures - #6250

Open
Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/voice-recorder-failure-recovery
Open

Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/voice-recorder-failure-recovery

Conversation

@Yzzz88

@Yzzz88 Yzzz88 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

What changed

Handle MediaRecorder construction/start exceptions and runtime error events through the existing device-error feedback. Release the microphone, reset recording state and timers, discard partial audio and detach failed recorder callbacks so the next attempt can start normally.

Why

A microphone may stop between permission approval and recorder startup, or the browser may fail to encode the stream. The current unhandled start exception leaves the composer in preparing with the stream retained. Runtime recorder errors are followed by data/stop events, which currently send partial audio for transcription instead of reporting the recording failure.

Validation

  • Three regressions fail on main and pass after the fix: constructor failure, start failure, and error followed by partial data/stop; each covers retry and microphone cleanup.
  • 36 voice input, composer context, shortcut and WAV tests pass; vue-tsc --build and diff check pass.
  • Headless Chromium using the actual production composable and native MediaRecorder: an ended Web Audio input stream causes the native start failure, returns to idle with device feedback, and a subsequent live stream records successfully. Input is synthesized; this does not claim physical microphone testing.

MediaRecorder's startup and error ordering are documented in the recording specification.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant