/
/
/
# What does this implement/fix? A dashboard cast session only ended via an explicit `dashboard/hide`. When the receiver app on the device died for any other reason (network hiccup leading to an app quit, user exits the app on the device, another app cast over it, an automation stopping the player), the session lingered forever: nothing was logged and the frontend kept showing the endpoint as "casting". - Add `DashboardController.end_session(dashboard_id, reason)`: drops the session, logs a warning (`Dashboard session on <name> ended: <reason>`) and signals `DASHBOARD_SESSIONS_UPDATED`, so the frontend's casting indicator clears itself - The chromecast provider now watches devices it casts to: a cast status where the receiver app is gone, replaced or restarted ends the session immediately; a lost device connection ends it after a 60s grace period - Same-app audio playback keeps the session alive (cast session id unchanged), and a connection blip that recovers re-verifies the app instead of ending the session - Add tests for the controller method and the provider liveness detection **Related issue (if applicable):** - related issue N/A ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have raised a PR against the documentation repository targeting the main or beta branch as appropriate. --------- Co-authored-by: Marvin Schenkel <[email protected]>