Skip to content

Fold stream/request-format into client/state - #195

Merged
kahrendt merged 5 commits into
mainfrom
refactor/drop-stream-request-format
Sep 2, 2026
Merged

Fold stream/request-format into client/state#195
kahrendt merged 5 commits into
mainfrom
refactor/drop-stream-request-format

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

stream/request-format was a request in name only: a decline is invisible (the stream continues and the request MUST NOT be treated as an error), so a client only ever learns the operative configuration from stream/start, and with no stream active the server already had to remember the requested format as de facto state. Per the CONTRIBUTING rule that fields expected to change during a connection belong in client/state, the message is dropped and its fields move there.

Changes

player gains an optional format preference in its state object; absent means the server selects per the supported_formats priority order, a present preference must be one of the listed entries (which also removes the previously undefined partial-request case), and the server may still deviate, for example to match a track's native sample rate or to apply an operator-configured format. artwork moves the per-channel source/format/width/height into a state channels array and artwork@v1_support is removed entirely: the array is positional from channel 0, an uncovered channel is source: 'none' so clients may truncate after their last active channel, an array longer than 4 is a protocol error, and format/width/height are required only when source is not 'none'. visualizer moves types, rate_max and spectrum into state; its hello object keeps only buffer_capacity. stream/start now derives each role's configuration from the hello constants plus the role's current state, answers a state change on an active stream with a new stream/start when the configuration changed, never starts a stream in response, and should wait for the state update a role (re-)activation requires before starting that role's stream.

Breaking changes

The stream/request-format message is removed; clients that send it break, and servers drop the handler. Artwork clients no longer send artwork@v1_support and instead carry their channel configuration in client/state; visualizer clients keep only buffer_capacity in their support object and carry the rest in client/state. Players are affected only if they used stream/request-format; the new format state field is optional.

Conflicts with #177 in the player state object; whichever lands second needs a rebase.

Closes #190

Comment thread messaging.md Outdated
Comment thread roles/artwork/v1.md Outdated
Comment thread roles/visualizer/v1.md
Comment thread roles/artwork/v1.md Outdated
Comment thread messaging.md
@marcelveldt marcelveldt added this to the 1.0.0 milestone Sep 2, 2026
@kahrendt
kahrendt merged commit 4a66efd into main Sep 2, 2026
1 check passed
@kahrendt
kahrendt deleted the refactor/drop-stream-request-format branch September 2, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move stream/request-format fields into client/state and drop the message

3 participants