fix(voice_ui): stop wake-word listener when a recording starts #17
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_voice!17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_listen_stop_on_record"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a client sent
Startwhile in wake-word listen mode, onlyis_recordingwas flipped totrue. Theis_listeningflag stayedtrueandlisten_processor's VAD buffer kept its stale contents. The existing!recordingguard on the wake-word branch prevented most user-visible impact, but the state inconsistency and the unreset buffer were real bugs (e.g. stale data surviving into the nextListen).This PR adds two lines to the
Startarm ofhandle_socketso thatStartnow cleans up listen state exactly the wayStopalready does.Related Issue
Closes #13
Changes
Single-file,
crates/hero_voice_ui/src/ws.rs, inside theClientMessage::Startarm:*is_listening.lock().await = falseso the flag stops being stale until the nextStop.listen_processor.lock().await.reset()so wake-word detection starts clean on re-entry.Test Results
cargo test --workspace— 18 passed, 0 failed.cargo clippy -p hero_voice_ui --all-targets -- -D warnings— clean.No unit test is added. The bug is a state-machine flag inside an async WebSocket handler whose surrounding context (
axum::WebSocket,mpscchannels,LocalTranscriber) is not currently factored for unit testing; extracting a helper purely to test two flag writes would add more indirection than it removes. Manual verification is the accepted path (see the spec comment on the issue).5d9362ff9bdccd9c1b47