Repository navigation
Clear unset metadata and color fields on older clients - #453
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The compatibility behavior is narrowly scoped, matches the linked specification history, and has focused regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds legacy-client serialization so omitted metadata and color fields are sent as null, while current clients retain spec-compliant omission behavior.
Changes:
- Introduces a legacy
server/stateserializer. - Selectively applies it to legacy connections.
- Adds coverage for legacy and current clients.
| File | Description |
|---|---|
aiosendspin/models/core.py |
Defines legacy state serialization. |
aiosendspin/server/connection.py |
Applies legacy serialization when required. |
tests/server/test_connection_writer.py |
Tests legacy nulls and current omission. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1 of 9 tasks
maximmaxim345
added a commit
that referenced
this pull request
Oct 2, 2026
# What does this implement/fix? <!-- Quick description and explanation of changes. --> Since #434, clearing metadata or color sends `{"metadata": null}` or `{"color": null}` to unencrypted clients. sendspin-cpp ignores a role value that isn't an object, so ESPHome devices kept the old title, artist, progress and colors after a clear. These clients now get the timestamp-only object, which #453 already expands into explicit null fields, the same shape 9.1.1 sent. Deactivation is unchanged. **Related issue or spec PR (if applicable):** - #453 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the matching label, and the release notes use it to sort this change. --> - [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` - [ ] Breaking change (changes the public API or the protocol in a way that is not backwards compatible): `breaking-change` - [ ] Refactor (no behavior change): `refactor` - [ ] Documentation only: `documentation` - [ ] Maintenance / chore: `maintenance` - [ ] CI / workflow change: `ci` - [ ] Dependencies bump: `dependencies`
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?
Since #408,
server/statesends full metadata and color objects with unset fields left out. Clients from before spec #175, like the aiosendspin client up to 9.1.1, still merge each object into the previous one, so a field that becomes unset (album, artwork, a color,progress) never clears, and a clearedprogresskeeps extrapolating.Legacy connections now get every unset metadata and color field as an explicit
null, which these clients read as a clear. Current clients still get the fields omitted.Related issue or spec PR (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies