mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2758] [Issue]: STT mic input — no stop path when disabled flips mid-recognition (+ lifecycle nits) #1397
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1397
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2758
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Minor STT/settings lifecycle issues. The notable one is that toggling the button's
disabledprop while recognition is live removes the only stop path and still funnels dictated text into a disabled input until the current utterance ends.Sub-bug 1: No stop path on mid-recognition disable (#50) [primary]
startListening's guardif (disabled) return;(86) precedes theif (listening) { stopListening(); }toggle (87); there is no effect keyed ondisabled. When the parent flipsdisabledtrue mid-listen (GameInput: generation starts; ChatInput: chat cleared), the button is DOM-disabled and the early-return blocks the toggle, so the user can't stop; the recording ring stays lit andonendstill firesonTranscript, writing dictated text into the now-disabled input. (Self-heals at utterance end sincecontinuous=false— bounded, not an indefinite leak.)Sub-bug 2: Stale voice selection (#17)
voiceis hydrated from saved config butvoiceOptionscomes only from the freshly-fetched list; a deleted/renamed/other-account ElevenLabs voice id has no matching<option>, so the select shows blank while state/payload still hold the stale id and preview/synthesis use it.Sub-bug 3: Untracked status timer (#51) [nit]
setTimeout(417) isn't stored or cleared; harmless on React 19 (no state-after-unmount warning) and only one narrow unmount path exists. Code-hygiene only.Sub-bug 4: Double-start SpeechRecognition (#16) [disputed/latent]
listeningclosure could orphan a second recognition IFstartListeningwere invoked twice synchronously — but no real path does this (single onClick, React commits between discrete clicks). Latent; guard on the ref for robustness.Suggested Fix
useEffect(() => { if (disabled && listening) recognitionRef.current?.abort(); }, [disabled, listening])(or reorder the guards), and skip writing transcript when disabled.voiceis non-empty and absent fromvoiceOptions, inject a synthetic '(saved)' option or surface a re-select warning (same for narratorVoice/per-character voices).startListeningonrecognitionRef.currentbefore creating a new instance.Verification checklist (all manual)
pnpm checkAffected files
packages/client/src/components/ui/SpeechToTextButton.tsxpackages/client/src/components/panels/settings/TTSConfigCard.tsxAudit provenance
Found by a multi-agent static audit of the TTS/voice + image-generation subsystems (Round 1 + round-2 gap sweep + completeness critic, each finding adversarially verified) against the merged
stagingtree. Severity: LOW.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Addressed on PR #2747. Fixed the STT disabled-mid-recognition path by aborting active recognition when disabled flips, preserving a stop path before the disabled guard, guarding double-starts with the recognition ref, and suppressing transcript writes while disabled. Also made saved/stale TTS voice IDs visible in voice selects/pools and tracked the saved-status timeout for cleanup. Validation so far: git diff --check. Full pnpm checks are intentionally deferred until the issue sweep is complete.