Skip to content

Fix premature sending of the connected state#82

Merged
maximmaxim345 merged 1 commit into
mainfrom
fix/volume-sync-connected-state
May 7, 2026
Merged

Fix premature sending of the connected state#82
maximmaxim345 merged 1 commit into
mainfrom
fix/volume-sync-connected-state

Conversation

@maximmaxim345
Copy link
Copy Markdown
Member

The Cast SDK fires SYSTEM_VOLUME_CHANGED at startup, before any SendspinPlayer exists. With that, the handler was sending status with state="connected" alongside the volume payload, causing Music Assistant to think that the App successfully started.

The Cast SDK fires SYSTEM_VOLUME_CHANGED at receiver boot before any
SendspinPlayer exists. The handler was sending status with
state="connected" alongside the volume payload, which the MA bridge
took as proof the Cast app had finished its connect handshake. Any
later AudioContext or connection failure was then swallowed because
the bridge's cast-ready future was already resolved.

Send state="connecting" so the future stays pending until the real
"Connected - ready to play" status fires after AudioContext is
verified and the WebSocket connect succeeds.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents the receiver from reporting state="connected" during early SYSTEM_VOLUME_CHANGED events (before a SendspinPlayer exists), avoiding premature “app started successfully” signals to Music Assistant.

Changes:

  • In the CAF receiver path, send state: "connecting" (instead of "connected") when only a volume update is available and no player exists yet.
  • Apply the same adjustment in the legacy Cast Receiver API path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maximmaxim345 maximmaxim345 merged commit 2b24b97 into main May 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants