Repository navigation
Fix sendspin-jvm adapter for ServerState.metadata type change - #107
Merged
Merged
Conversation
sendspin-jvm's Sendspin/sendspin-jvm#33 wrapped ServerState.metadata/ controller/color in JsonOptional<T> to fix a bug where the client couldn't distinguish "role omitted" (leave unchanged) from "role explicitly null" (clear), per spec PR #175. This adapter read state.metadata as a plain TrackMetadataMsg?, breaking the build. Fixed using the same JsonOptional.orNull() idiom this file already uses elsewhere (e.g. meta.title.orNull() in addMetadataFields). Functionally equivalent to the old code for the non-null-clearing case this adapter cares about (tracking the last received metadata value). Verified: `python -m conformance.build` succeeds for sendspin-jvm-client and the aiosendspin_server smoke-test import passes locally. Could not exercise the full conformance matrix in this sandbox (client/server socket timeouts even against the previous, already-passing commit — a local networking limitation, not a regression from this change). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…dth/height rename aiosendspin's own ArtworkChannel model (fixed in a companion PR to Sendspin/aiosendspin) is being updated for spec PR #168 ("Letterbox art and remove BMP support"): media_width/media_height -> width/height, and BMP dropped from PictureFormat entirely. This adapter constructed ArtworkChannel directly with the old kwarg names and referenced PictureFormat.BMP, which would break once that aiosendspin fix lands. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 tasks done
maximmaxim345
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Sep 8, 2026
…t, drop BMP (#343) ## Summary Implements [spec PR #168](Sendspin/spec#168) ("Letterbox art and remove BMP support"), which aiosendspin hadn't caught up to yet: - `ArtworkChannel` (the `artwork@v1_support` object in `client/hello`) and `StreamRequestFormatArtwork` (`stream/request-format`): `media_width`/`media_height` → `width`/`height`. - `PictureFormat`: `'bmp'` is out of the spec's format set (servers must support `'jpeg'` and `'png'`), but stays parseable and encodable for clients that still declare it. - Letterboxing (scale to fit + pad the remaining area with black, never crop) was **already implemented** in `ArtworkGroupRole._letterbox_image` — no behavior change needed there, it already matches the new "deliver at exactly `width` x `height`" requirement. - Both superseded spellings stay accepted: `media_width`/`media_height` are rewritten to `width`/`height` on parse, and a `'bmp'` declaration is still served as BMP. Each routes through `flag_noncompliance`, so a lenient server logs once and keeps working while `allow_noncompliant_clients=False` rejects the client. ## Why now This was surfaced by [Sendspin/sendspin-jvm#33](Sendspin/sendspin-jvm#33) adopting the new field names ahead of aiosendspin. Once that merged, `Sendspin/conformance`'s cross-SDK matrix started failing every `aiosendspin -> sendspin-jvm` scenario (9 of them) — not just the artwork one — because aiosendspin was rejecting `client/hello` outright as malformed (`media_width`/`media_height` are required fields, and sendspin-jvm no longer sends them). See [Sendspin/conformance#107](Sendspin/conformance#107) for the client-side half of this (the conformance harness's own artwork-scenario code also constructed `ArtworkChannel` with the old kwarg names). ## Test plan - [x] `pytest tests/server/roles/artwork/ tests/test_client_protocol_callbacks.py tests/server/test_multi_server.py` — 114 passed - [x] Full repo suite otherwise unaffected — 9 pre-existing failures elsewhere in this sandbox are native `av`/PyAV extension loading timeouts (confirmed unrelated: none touch `artwork`/`PictureFormat`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Maxim Raznatovski <nda.mr43@gmail.com>
2 tasks done
chrisuthe
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Sep 15, 2026
## Summary Implements [spec PR #164](Sendspin/spec#164) ("rename static_delay_ms to output_delay_ms"), which aiosendspin hadn't caught up to yet: - `PlayerStatePayload.static_delay_ms` → `output_delay_ms` - `PlayerCommandPayload.static_delay_ms` → `output_delay_ms` - `PlayerCommand.SET_STATIC_DELAY` (`"set_static_delay"`) → `SET_OUTPUT_DELAY` (`"set_output_delay"`) - `StaticDelayChangedEvent` → `OutputDelayChangedEvent` (a public event type this repo exposes, not wire-facing, but part of the same rename — missed in the first commit, fixed in the second) Applied consistently across the server-side player role, client-side model usage, and docstrings. **Backward compatibility** (mirroring [#343](#343 "keep serving clients on the pre-rename artwork wire"): a client still using `static_delay_ms`/`set_static_delay` is tolerated, not disconnected. - `PlayerCommand.SET_STATIC_DELAY` stays a valid enum value. - `PlayerStatePayload.__pre_deserialize__` rewrites incoming `static_delay_ms` onto `output_delay_ms`, recording `legacy_delay_key` so `PlayerV1Role.client_state_deviations()` flags it — tolerated when the server allows noncompliant clients, rejected in strict mode via the existing `flag_noncompliance` machinery (no new enforcement path needed). - `set_output_delay()` now addresses the client using whichever spelling it declared in `state_supported_commands` — a client that only ever declared `set_static_delay` wouldn't recognize a `set_output_delay` command in `server/command`. - `PlayerCommandPayload.__post_serialize__` serializes `output_delay_ms` under the wire key matching `command`, so constructing the payload with `command=SET_STATIC_DELAY` produces the pre-rename wire shape from the same Python-side field. ## Why now Same root cause as #343: [Sendspin/sendspin-jvm#33](Sendspin/sendspin-jvm#33) adopted the new field names ahead of aiosendspin. Once #343 merged and got a sendspin-jvm client's `client/hello` past the artwork-parsing failure, `client/state` then failed for the same reason one layer deeper — a sendspin-jvm client sends `output_delay_ms` and declares `set_output_delay` in `supported_commands`, and aiosendspin rejected it: `"'set_output_delay' is not a valid PlayerCommand"`. See [Sendspin/conformance#107](Sendspin/conformance#107) for where this surfaced (re-running the matrix after #343 merged). ## Test plan - [x] Full test suite: `pytest -n0` (xdist disabled — its worker-spawn native `av`/PyAV extension loading is flaky in this sandbox, independent of this change) — 1606 passed, 8 skipped, 0 failed - [x] `ruff check` and `ruff format --check` both clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Chris Uthe <chris.uthe@openhomefoundation.org>
Contributor
Author
|
The failures are unrelated to sendspin-jvm and exist on master. |
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.
Summary
This kept peeling back a layer at a time, all from the same root cause: Sendspin/sendspin-jvm#33 adopted several spec renames that aiosendspin hadn't caught up to yet.
Build break (fixed):
sendspin-jvm#33wrappedServerState.metadata/controller/colorinJsonOptional<T>(fixing a real bug — distinguishing "role omitted" from "role explicitlynull" per spec PR #175). Broke this repo'ssendspin-jvmadapter, which readstate.metadataas a plainTrackMetadataMsg?. Fixed with theJsonOptional.orNull()idiom this file already uses elsewhere.Artwork field rename (fixed, merged): once the build was fixed, the full
aiosendspin -> sendspin-jvmmatrix failed all 9 scenarios — sendspin-jvm's PR [Spec coverage] External source handling (state: 'external_source') #33 batch also adopted spec PR #168 (media_width/media_height→width/height, BMP dropped), which aiosendspin didn't support yet, so it rejected everyclient/helloas malformed. Fixed in Sendspin/aiosendspin#343 (merged) plus this repo's ownaiosendspin_client.py/aiosendspin_server.pyadapters, which also used the old field names.Player delay field rename (fix opened, includes backward-compat like #343): with #343 merged,
client/hellonow parses, butclient/statefails one layer deeper — sendspin-jvm sendsoutput_delay_msand declaresset_output_delayinsupported_commands(also from the PR [Spec coverage] External source handling (state: 'external_source') #33 batch, spec PR #164), which aiosendspin still callsstatic_delay_ms/set_static_delay. Fix opened: Sendspin/aiosendspin#351, which also tolerates clients still on the old spelling (mirroring #343's pattern).This PR depends on #351 merging for the full matrix to go green, since the harness resolves
aiosendspinas a sibling git checkout, not a pinned/published version.Test plan
python -m conformance.build(build_selected_adapters({"sendspin-jvm-client"})) succeedsimport conformance.adapters.aiosendspin_serversmoke-test import passesconformance run --from aiosendspin --to sendspin-jvm) — needs Sendspin/aiosendspin#351 merged first; re-run this PR's CI once that lands (there may be further layers — each fix so far has surfaced the next one deeper in the handshake)🤖 Generated with Claude Code