Repository navigation
Description
Summary
After a user stops a voice recording and accepts transcription, navigating to another bb page before processing finishes cancels the request and loses the transcript. Accepted transcription should continue in the background and return its text to the originating draft even when that composer is no longer mounted.
Versions and environment
- Reproduced from source at
a60b895dc5605b39417bf3fedb827d6e5d3e6e86(main) - bb
0.43.4-nightly.35739502552.1 - Linux 6.8.0-124-generic, x86_64
- Node
24.19.0 - BB-managed worktree environment
Steps to reproduce
- Open a new-thread or thread follow-up composer.
- Start voice input and record for at least one second.
- Press the checkmark to stop and transcribe the recording.
- While the composer shows that transcription is processing, navigate to another bb page so the composer unmounts.
- Wait for the transcription request to settle, then return to the originating composer.
A deterministic hook-level reproduction on main starts transcription, unmounts the voice-input hook, and inspects the accepted request's abort signal.
Expected vs actual
Expected: signal.aborted === false, transcription completes, and its text is added to the originating draft.
Actual: signal.aborted === true, the request rejects with AbortError, and no text is added to the draft.
Evidence
The composer-unmount cleanup explicitly aborts the in-flight transcription request:
bb/apps/app/src/hooks/useVoiceInput.ts
Lines 224 to 244 in a60b895
| useEffect(() => { | |
| return () => { | |
| const recorder = mediaRecorderRef.current; | |
| if (recorder && recorder.state === "recording") { | |
| try { | |
| recorder.stop(); | |
| } catch {} | |
| } | |
| mediaRecorderRef.current = null; | |
| chunksRef.current = []; | |
| startedAtMsRef.current = null; | |
| promptContextRef.current = undefined; | |
| shouldTranscribeRef.current = true; | |
| releaseRecordingWakeLock(); | |
| if (transcriptionAbortRef.current) { | |
| transcriptionAbortRef.current.abort(); | |
| transcriptionAbortRef.current = null; | |
| } | |
| stopMediaStream(); | |
| }; | |
| }, [releaseRecordingWakeLock, stopMediaStream]); |
The success callback only targets the mounted editor ref, so a successful result would also be discarded after that editor unmounts:
bb/apps/app/src/components/promptbox/usePromptVoice.ts
Lines 23 to 31 in a60b895
| export function usePromptVoice( | |
| promptBoxRef: RefObject<PromptBoxHandle | null>, | |
| ): PromptVoiceConfig { | |
| const onTranscript = useCallback( | |
| (text: string) => { | |
| promptBoxRef.current?.insertTextAtCursor(text); | |
| }, | |
| [promptBoxRef], | |
| ); |
Remote CI run 35918083137 reproduced the lifecycle failure in useVoiceInput.test.tsx:
FAIL @bb/app:isolated src/hooks/useVoiceInput.test.tsx > keeps an accepted transcription running after unmount
AssertionError: expected true to be false
- Expected: false
+ Received: true
Test Files 1 failed | 184 passed | 1 skipped
Tests 1 failed | 1723 passed | 5 skipped
Investigation thread: thr_insxup7qfh
What you ruled out
- Searched open and closed issues for voice transcription navigation, unmount, and lost drafts; no matching issue was found.
- Still present on
mainata60b895dc5605b39417bf3fedb827d6e5d3e6e86. - Explicit user cancellation is a separate path and should continue to abort processing.
- Navigating away before pressing the checkmark should continue to discard the unaccepted recording.
Suggested priority and effort
Medium-high — this silently loses user-authored voice input during ordinary in-app navigation; the workaround is to remain on the page until processing finishes.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 24, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · High priority · Medium effort ·
ui(all previously missing).Reproduction report: REPRODUCED, high root-cause confidence. Applied
confirmed-repro.Unmount cleanup aborts accepted transcription; the success callback also has no draft destination once the editor ref clears. The focused hook test failed identically in two trusted checkouts: aborted signal and zero transcript deliveries (three existing tests passed each time).
No PR: complete lifecycle and originating-draft routing changes, with regression coverage, exceed the five-file simple-fix limit.
Preserve accepted voice transcription across navigation (get-bb#4330)