Handle microphone init failure without aborting#945
Handle microphone init failure without aborting#945ferologics wants to merge 3 commits intocjpais:mainfrom
Conversation
Return recorder init errors instead of panicking/aborting in the worker thread and reset UI state when recording start fails. Refs cjpais#436
|
@ferologics have you tested this yourself to verify? Just want to make sure. Also do you know if the UI visibly says anything about this failure case? |
|
@cjpais i wasn't able to make handy run locally from source (ref) so i couldn't test. I came across the crash due to having disabled microphone globally via settings. Tried to make this change isolated to that, not touching any UI. Onboarding / in-app hints about disabled mic could made be better tho. Right now when the crash happens it briefly shows the recording UI and then it disappears, no info in the app / anywhere about it. |
|
re: the microphone access denied bit -- it comes directly from my local agent. i had it check the crash log, look at current system settings configuration and patch that particular case in handy. |
|
Got it, I am going to push some changes for the UI I think. Let's get your build env fixed |
Summary
This PR prevents a hard crash when microphone stream initialization fails (for example, when Windows microphone privacy blocks access).
What changed
src-tauri/src/audio_toolkit/audio/recorder.rsAudioRecorder::open(expect/unwrap/panic) with explicit error propagation.open()only succeeds after worker initialization succeeds.src-tauri/src/actions.rsWhy
In release builds (
panic = "abort"), panic paths during recorder startup can terminate the process. This keeps startup failure as a normal error path instead.Refs #436