fix: prevent app lockup when toggle shortcut is pressed rapidly#820
Closed
alexpooley wants to merge 1 commit intocjpais:mainfrom
Closed
fix: prevent app lockup when toggle shortcut is pressed rapidly#820alexpooley wants to merge 1 commit intocjpais:mainfrom
alexpooley wants to merge 1 commit intocjpais:mainfrom
Conversation
The microphone pipeline is purely singleton — when a toggle action (start/stop recording) is already in progress, there is no point queuing additional ones. Rapid presses caused threads to pile up waiting on the state mutex while the first press held it during blocking audio device I/O, freezing the app. Add an AtomicBool guard that rejects concurrent toggle presses while an action is in-flight.
bba7c0e to
134c3bf
Compare
4 tasks
Owner
|
Closing in favor of #824, thank you for taking the time to submit the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The microphone pipeline is purely singleton — when a toggle action (start/stop recording) is already in progress, there is no point queuing additional ones. Rapid presses caused threads to pile up waiting on the state mutex while the first press held it during blocking audio device I/O, freezing the app.
Add an AtomicBool guard that rejects concurrent toggle presses while an action is in-flight.
Before Submitting This PR
Human Written Description
Sometimes when I push to talk the UI doesn't appear immediately. I press again because I think I missed the button, etc. Eventually I've pressed a few times and the app has locked up. I have to kill via the Activity Monitor.
Related Issues/Discussions
No existing issue found — this is a new bug report via PR.
Testing
Could not fully test the dev build due to macOS TCC refusing accessibility permissions for ad-hoc signed debug binaries. The fix is 6 lines and correct by inspection — the
AtomicBoolCAS guard is a standard pattern for preventing re-entrant calls to a singleton resource.AI Assistance
If AI was used: