Skip to content

fix(app): throttle notification sounds and unblock directory bootstrap - #48550

Open
yeager1977 wants to merge 1 commit into
anomalyco:devfrom
yeager1977:app-sound-bootstrap
Open

fix(app): throttle notification sounds and unblock directory bootstrap#48550
yeager1977 wants to merge 1 commit into
anomalyco:devfrom
yeager1977:app-sound-bootstrap

Conversation

@yeager1977

Copy link
Copy Markdown

Issue for this PR

Closes #43903

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Two desktop startup problems:

  1. Notification sound burst on startup. 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, producing a burst of chopped/overlapping sounds. Adds a global 2s cooldown in playSoundById so bursts collapse to one sound. Settings previews now use an unthrottled playSoundPreview player so explicit previews always play.

  2. Slow session render when an MCP server is 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.

The throttling lives in a small createSoundPlayer factory 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 typecheck clean in packages/app.

Screenshots / recordings

Non-visual behavior change; no screenshot applicable.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows Desktop] Session error notification + sound replays on every launch (event backlog has no replay guard)

1 participant