Skip to content

fix(web): keep voice-note processing owned by its recording - #3464

Open
vedanth-jadhav wants to merge 3 commits into
CapSoftware:mainfrom
vedanth-jadhav:fix/web-voice-recorder-run-ownership
Open

vedanth-jadhav wants to merge 3 commits into
CapSoftware:mainfrom
vedanth-jadhav:fix/web-voice-recorder-run-ownership

Conversation

@vedanth-jadhav

@vedanth-jadhav vedanth-jadhav commented Oct 27, 2026 •

Copy link
Copy Markdown

A voice note can finish waveform decoding after its recorder unmounts or the take is canceled. The old completion still calls onFinish, which starts the comment upload, and can reset a newer take. A delayed mixer from an abandoned startup can also stop the replacement microphone.

Keep asynchronous stop/decoding work tied to its recording run, and release only the abandoned stream when a stale mixer completes. The current take still produces its blob, duration and waveform normally. If MediaRecorder rejects start or restart, release the microphone and mixer and reset the recorder instead of leaving capture active.

Validation: 23 focused tests pass, including nine mounted voice-recorder lifecycle cases, two existing comment-recorder lifecycle tests and 12 waveform tests. Four ownership cases fail on baseline 8dd141d; the successful recording and late-permission controls pass. Two encoder-start failure cases also fail on the initial PR head and pass with the follow-up. The delayed-stop regression verifies the replacement can finish; removing its run-ownership guard makes the test fail. The tests use real React hooks and controlled media/mixer events, without claiming physical microphone validation. Scoped strict TypeScript, Biome, CI YAML parsing and git diff --check pass. Full web build/typecheck was not run. Current main 97c8d63 has the same affected code.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Keeps voice-note completion tied to its recording and releases capture when the encoder cannot start.

  • Canceled voice-note work cannot finish or disrupt a newer take.
  • Voice-note start failures release capture and let people retry.

Reviews (2) · Last reviewed commit: "test(web): cover delayed voice recorder ..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread apps/web/__tests__/unit/voice-recorder-lifecycle.test.ts

Copy link
Copy Markdown
Author

@greptile please review the delayed-stop regression test in fc5d591.

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