moeru-ai/airi · warning
Error stopping recognition instance:
Error message
Error stopping recognition instance:
What it means
In the transcription provider settings test, testRecognitionInstance.value.stop() threw during stopSTTTest — usually because the recognition already stopped or was aborted first. The nested catch keeps the outer teardown going: the instance reference is nulled and the abort controller fires afterwards. UI state still lands on 'Stopped'.
Source
Thrown at packages/stage-pages/src/pages/settings/providers/transcription/browser-web-speech-api.vue:261
testStatusMessage.value = `Error: ${testTranscriptionError.value}`
isTranscribing.value = false
isTestingSTT.value = false
console.error('Web Speech API test error:', err)
}
}
async function stopSTTTest() {
isTestingSTT.value = false
isTranscribing.value = false
testStatusMessage.value = 'Stopped'
try {
// Stop recognition instance if we have one
if (testRecognitionInstance.value) {
try {
testRecognitionInstance.value.stop()
}
catch (err) { console.warn('Error stopping recognition instance:', err) }
testRecognitionInstance.value = null
}
// Abort the abort controller
if (testAbortController.value && !testAbortController.value.signal.aborted) {
testAbortController.value.abort()
testAbortController.value = null
}
}
catch (err) {
console.error('Error stopping STT test:', err)
}
// Finalize transcription if we have streaming text
if (testStreamingText.value.trim() && !testTranscriptionText.value) {
testTranscriptionText.value = testStreamingText.value.trim()
}
View on GitHub (pinned to 677329427f)
Solutions
- Ignore the warning — UI state resets to 'Stopped' regardless
- Make stopSTTTest idempotent: early-return when isTestingSTT is already false
- Null the instance reference before calling stop() to prevent double-stop
- Catch InvalidStateError specifically and stay quiet on it
Defensive patterns
Strategy: try-catch
Validate before calling
if (!testRecognitionInstance.value) return // nothing to stop (source guard)
Try / catch
try {
testRecognitionInstance.value.stop()
}
catch (err) {
console.warn('Error stopping recognition instance:', err) // InvalidStateError expected on double-stop
}
testRecognitionInstance.value = null // always drop the reference (source pattern) Prevention
- Make stopSTTTest idempotent: early-return when isTestingSTT is already false
- Abort the controller before stopping recognition to avoid double-stop races
- Ignore InvalidStateError from recognition.stop(); the instance is discarded anyway
When it happens
Trigger: Clicking Stop after the test recognition already ended; the test timeout aborted the controller first; double-clicking the stop button.
Common situations: Tester double-clicks Stop; test timed out and the user clicks Stop afterwards; permission prompt dismissed mid-test.
Related errors
- Error stopping Web Speech API recognition:
- Web Speech API is not available in this environment. It requ
- Web Speech API error:
- Web Speech API: Microphone access issue. Please check microp
- Web Speech API failed to restart, creating new instance:
AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18).
Data as JSON: /api/errors/7470568461c5204f.
Report an issue: GitHub.