fix: harden notification sound playback against hangs and dropped sounds - #116
Open
GraysonCAdams wants to merge 3 commits into
Open
fix: harden notification sound playback against hangs and dropped sounds#116GraysonCAdams wants to merge 3 commits into
GraysonCAdams wants to merge 3 commits into
Conversation
This was referenced Aug 18, 2026
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.
TopNotify's sound queue used a bare
BlockingCollection<T>.TryAdd(item), which blocks indefinitely once the queue is full rather than skipping the item as the surrounding logic assumed - a burst of notifications could deadlock playback entirely. Separately, the daemon/GUI pipe usedStreamReader/StreamWriterwithAutoFlush, which falls back to an uncancellable synchronousPipeStream.Writeunder load; confirmed viadotnet-dumpthread stacks that both processes could genuinely get stuck mid-write with no way to recover short of killing the process.Fixed both: the queue now uses
TryAdd(item, TimeSpan.Zero)so a full queue drops rather than blocks, and the pipe now uses raw asyncReadAsync/WriteAsyncbound to aCancellationTokenSourcewithPipeOptions.Asynchronouson both ends (it was missing on the client, which was the actual root cause).SendCommandToDaemonnow returns whether the daemon actually acknowledged, instead of assuming success.