mirror of
https://github.com/SillyTavern/Extension-Speech-Recognition.git
synced 2026-10-15 13:32:06 +00:00
[PR #29] Fix mic cleanup when transcription fails; make mic icon state idempotent #29
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SillyTavern/Extension-Speech-Recognition#29
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?
📋 Pull Request Information
Original PR: https://github.com/SillyTavern/Extension-Speech-Recognition/pull/29
Author: @northcraftfoundries
Created: 9/24/2026
Status: 🔄 Open
Base:
main← Head:fix/recorder-cleanup📝 Commits (2)
82edb71fix: make mic icon activate/deactivate idempotentedaf939fix: release mic and restore click handler when transcription fails📊 Changes
1 file changed (+37 additions, -25 deletions)
View changed files
📝
index.js(+37 -25)📄 Description
Two small fixes to the shared recording path in
index.js. They affect every MediaRecorder-based provider.Release the mic and restore the click handler when transcription fails
mediaRecorder.onstopawaitedprocessAudiowithout a try/catch. If the provider threw (for example, the server was unreachable or returned an HTTP error), the rejection went unhandled and the cleanup never ran:The transcription is now wrapped in try/catch/finally. The cleanup uses a local reference to the recorder and is skipped if the user switched providers mid-transcription, so it can't rebind the mic button away from the new provider.
Make mic icon activate/deactivate idempotent
toggleClassflipped whatever state the button was in. CallingactivateMicIcontwice, ordeactivateMicIconon an idle button, left the icon inverted. The classes are now set explicitly.How to test
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.