Conversation
Starting different content through a saved group can replay the protocol group’s cached metadata and artwork to newly joined screens before the new queue publishes. Clear that snapshot before members join, while preserving cached replay for ordinary joins to existing playback. Carry the actual protocol owner and takeover token through group formation, automatic power-on, and playback. Finish with current metadata on success and abort on failure or cancellation. Generation checks and serialized publication prevent stale asynchronous artwork or metadata work from repopulating the cleared snapshot. Keep artwork cache updates tied to successful publication and build metadata as a single Metadata result. Include end-to-end fake-power, protocol-owner, cancellation, artwork, and progress regressions.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new takeover-token ownership contract needs documentation before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes stale Sendspin metadata appearing when a sync group takes ownership of playback.
Changes:
- Adds transactional metadata takeover handling with generation guards.
- Coordinates group formation, auto-power, playback, and takeover cleanup.
- Adds regression coverage for success, failure, cancellation, and stale artwork races.
File summaries
| File | Description |
|---|---|
music_assistant/controllers/players/controller.py |
Coordinates takeover transactions during grouping and playback. |
music_assistant/models/player.py |
Adds generic playback-preparation and takeover hooks. |
music_assistant/providers/sendspin/player.py |
Serializes and generation-guards metadata publication. |
music_assistant/providers/sync_group/player.py |
Carries takeover ownership through group formation and playback. |
tests/controllers/players/test_active_protocol_lifecycle.py |
Tests initial group capture ordering. |
tests/controllers/players/test_player_controller.py |
Tests takeover ownership and failure cleanup. |
tests/controllers/players/test_player_grouping.py |
Updates membership-call expectations. |
tests/providers/sendspin/test_content_takeover.py |
Adds Sendspin takeover race regressions. |
tests/providers/sendspin/test_explicit_stop_bridge_notify.py |
Updates stop test setup. |
tests/providers/sendspin/test_resume_progress_extrapolation.py |
Tests metadata preservation behavior. |
tests/providers/sendspin/test_stop_progress_freeze.py |
Updates stop test setup. |
tests/providers/sync_group/test_sync_group.py |
Tests takeover lifecycle within sync groups. |
Review details
Suppressed comments (1)
music_assistant/controllers/players/controller.py:3665
- [PROBLEM] This helper now accepts
new_contentand transfers ownership of a takeover token, but its existing parameter documentation omits both parts of that contract; document them to prevent callers from leaving metadata publication suppressed.
*,
new_content: bool = False,
) -> tuple[Player, object] | None:
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
Feedback addressed, thank you @OzGav |
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.
What does this implement/fix?
I have a 'screen' device in a static sendspin group alongside a WiiM, and I noticed that I would often see, at the start of playback of the group, a "flash" (or sometimes several seconds) of the metadata and album art of the WiiM's individual player from whatever it had played last. Then the metadata and artwork of the group player would come through and overwrite it, fixing the glitch. I thought it was going to be relatively simple but a few days of testing showed there to be a ton of edge-case and race conditions to account for. Which is how I ended up with this including "generations" and serializing publication so we don't flap the state back and forth.
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.