fix(app): throttle notification sounds and unblock directory bootstrap - #48550
Open
yeager1977 wants to merge 1 commit into
Open
fix(app): throttle notification sounds and unblock directory bootstrap#48550yeager1977 wants to merge 1 commit into
yeager1977 wants to merge 1 commit into
Conversation
Two desktop startup issues: 1. Startup played a burst of chopped/overlapping notification sounds. Every directory instance publishes session.error for broken plugins (e.g. a missing plugin package), and the app played the error sound for each event with no throttling. Add a global 2s cooldown in playSoundById so bursts collapse to a single sound; settings previews use an unthrottled playSoundPreview player. 2. Session screens took very long to render content when an MCP server was unreachable. bootstrapDirectory awaited MCP status/resources, so directory readiness waited up to the MCP connect timeout per server. MCP queries now warm in the background and no longer gate readiness. (cherry picked from commit 6c4d6c7d31ad5a6660002e6e6e7e3c09178a91df)
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.
Issue for this PR
Closes #43903
Type of change
What does this PR do?
Two desktop startup problems:
Notification sound burst on startup. Every directory instance publishes
session.errorfor broken plugins (e.g. a missing plugin package), and the app played the error sound for each event with no throttling, producing a burst of chopped/overlapping sounds. Adds a global 2s cooldown inplaySoundByIdso bursts collapse to one sound. Settings previews now use an unthrottledplaySoundPreviewplayer so explicit previews always play.Slow session render when an MCP server is unreachable.
bootstrapDirectoryawaited MCP status/resources, so directory readiness waited up to the MCP connect timeout per server. MCP queries now warm in the background and no longer gate readiness.The throttling lives in a small
createSoundPlayerfactory so the coalescing and cooldown are unit-testable with an injected clock.How did you verify your code works?
src/utils/sound.test.ts: burst collapses to one sound, plays again after cooldown, concurrent plays suppressed even with slow loading, unknown/undefined sounds ignored, failed load doesn't block a later sound.src/context/global-sync/bootstrap.test.ts: directory is marked complete without waiting for a slow MCP server.bun test --conditions=solid --preload ./happydom.ts: 16 pass, 0 fail.bun typecheckclean inpackages/app.Screenshots / recordings
Non-visual behavior change; no screenshot applicable.
Checklist