Fix: mic audio killed after cancelling a native-capture recording (#699) - #1003
SomSamantray wants to merge 1 commit into
Conversation
Cancelling a native-capture recording (clicking the "X"/cancel button) never stopped the mic fallback recorder's getUserMedia stream. The stale mic track stayed open, so starting the next recording opened a second concurrent mic stream and produced silent/dead audio until the user manually reselected the microphone. cancelRecording's native-capture branch now stops the mic fallback recorder alongside discarding the native capture, mirroring the cleanup stopRecording already performs. Fixes webadderallorg#699 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: webadderallorg/Recordly/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughNative recording cancellation now stops the microphone fallback recorder alongside native capture disposal. Tests verify that native cancellation invokes the fallback stop callback. ChangesNative recording cancellation cleanup
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Cancelling a native-capture recording (clicking the "X"/cancel button) never stopped the mic fallback recorder's
getUserMediastream. The stale mic track stayed open, so the next recording opened a second, concurrent mic stream and produced silent/dead audio until the user manually reselected the microphone device.cancelRecording's native-capture branch now stops the mic fallback recorder alongside discarding the native capture (viaPromise.allSettled), mirroring the cleanupstopRecordingalready performs in both its warm-start and normal branches.Motivation
Fixes a reproducible audio bug reported in #699: recording, cancelling, then immediately recording again leaves the user with no microphone audio.
Type of Change
Related Issue(s)
Fixes #699
Screenshots / Video
Not applicable — this is an internal media-cleanup fix with no UI change.
Testing Guide
npm test— full suite passes (1194 tests), including a new test:stops the mic fallback recorder when cancelling native recordinginsrc/hooks/useScreenRecorder.test.ts.npx tsc --noEmitandnpx biome lint— clean on the changed files.Checklist
Scope
Change is intentionally narrow: only the native-capture branch of
cancelRecordinginsrc/hooks/useScreenRecorder.tsis touched. The webcam and plain-mediaRecordercancel branches already clean up their own media correctly and are left untouched to minimize the diff and regression risk.Disclosure
This change was drafted with AI assistance (Claude Code) and reviewed, tested, and verified by me before submission.
Summary by CodeRabbit