Repository navigation
refactor: rename client_stream/* to client-stream/*, document prefix rule - #163
Merged
Merged
Conversation
…rule Renames the only underscore message prefix: client_stream/start becomes stream/client-start and client_stream/end becomes stream/client-end. The stream/ prefix is a category, not a sender - these messages control a binary channel exactly like stream/start, stream/end, and stream/clear, so they keep the category prefix and carry the direction in the name. Also documents the message-type prefix rule in the Communication section of messaging.md: client/ and server/ name the sender, stream/ groups the binary-channel control messages regardless of sender, the other prefixes name a subject, and messages outside client/ and server/ define their own direction. BREAKING CHANGE: the two message types change on the wire for source clients. No other message type changes. Fixes #150
maximmaxim345
requested changes
Aug 20, 2026
maximmaxim345
left a comment
Member
There was a problem hiding this comment.
Can you adjust this PR to instead call it client-stream/start and client-stream/end? I think this got mixed up since the description of #163 still suggested stream/client-start.
See #150 (comment)
Review on #163 (maximmaxim345) settled the names from the #150 discussion: client-stream/start and client-stream/end - the underscore goes, but the messages keep their own prefix rather than joining stream/. Server-to-client and client-to-server binary channels are independent and have separate lifetimes, so folding both under one prefix would blur that. The prefix rule in messaging.md is rewritten accordingly: stream/ groups the messages controlling a server-to-client channel, client-stream/ those controlling a client-to-server channel.
Resolves the roles/source/v1.md conflict with #161: keep the promoted (non-Note) format-announcement sentence from main and apply the client-stream/start rename to it. README.md regenerated.
4 tasks done
chrisuthe
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Sep 16, 2026
# What does this implement/fix? Implements spec [#163](Sendspin/spec#163). `client_stream/start` and`client_stream/end` become `client-stream/start` and `client-stream/end` on the wire. The discriminator accepts both spellings for the same message, driven by one map of superseded names in `models/types.py`, so a later rename joins it rather than growing a second mechanism. A source still on the old spelling is served and flagged, exactly as the legacy `client/state` field and the pre-rename artwork dimension keys already are — which means a server running `allow_noncompliant_clients=False` will drop it, that being what opting into strict mode has always meant. The name a message arrived under survives on the parsed message, so nothing has to be recorded alongside it. NOTE: - **The Python identifiers are deliberately unchanged**, unlike the sibling rename in #351. There, a word changed (`static` → `output`). Here only the separator moved, and a hyphen is not a Python identifier character — `on_client_stream_start` already spells `client-stream/start` as closely as a method name can. `Role.on_client_stream_start` is an ABC hook with a no-op default, so renaming it would silently stop delivering the callback to any embedder who did not follow, and buy nothing. - The client emits the new spelling, so it requires a server that understands it. That is the same trade as the other renames in this series. **Related issue (if applicable):** - n/a ## Types of changes - [x] Refactor (no behaviour change) — `refactor` ## 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.
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.
Fixes #150.
Revised after review: names are now
client-stream/*, per the final discussion on #150. The issue body still shows the supersededstream/client-*form.Change 1:
client_stream/*→client-stream/*client_stream/start→client-stream/start,client_stream/end→client-stream/end. The underscore goes; the messages keep their own prefix rather than joiningstream/, because server→client and client→server binary channels are independent and have separate lifetimes. All 18 occurrences are inroles/source/v1.md; the two section headings move with their anchors and in-file links are updated (build-verified). No other file links to these sections.sourcerole. No other message type changes.Change 2: the prefix rule
Added to the Communication section of
messaging.md, directly after thetype/payloadparagraph:The closing sentence is what places
stream/request-format(client-sent, but controlling the server→client channel) correctly. Body text rather than a**Note:**, in keeping with #147.Coordination
#161 (open) touches
roles/source/v1.mdon one of the same lines (the promoted format-announcement note). Whichever merges second needs a trivial rebase + README rebuild — happy to do that on this side.Verification
client_streamorstream/client-occurrences remain in any source file.python3 tools/build-readme.py --checkpasses — the renamed headings' anchors and all links to them resolve.