Repository navigation
pb-client, pb-core, pb-service: each declares the protocol version it implements - #16
Merged
Merged
Conversation
… implements PROTOCOL_VERSION and MIN_PROTOCOL_VERSION lived in pybricks-core, and the client and the service read them from there. Each package requires pybricks-core at a minimum version with no maximum, so an older client or service installed beside a newer pybricks-core read the newer number and claimed a protocol it did not implement, which the handshake cannot catch. That happened installing pybricks-cli 1.0.0b2 from a stale index: pybricks-core 1.0.0b2 with pybricks-client 1.0.0b1 and pybricks-service 1.0.0b2, all saying protocol 4. The version is a promise about behaviour, so it belongs to the code that behaves. pb-client declares PROTOCOL_VERSION, the version it speaks, in pb_client.service. pb-service declares PROTOCOL_VERSION and MIN_PROTOCOL_VERSION, the versions it serves, in pb_service.methods.service, with the rules for moving them. A test checks that the two agree. Both are removed from pybricks-core, which is a breaking change, made while the packages are in beta. pybricks-client 1.0.0b2 and pybricks-service 1.0.0b3 import them from there, so either installed beside a pybricks-core without them fails to import, rather than claiming a protocol it does not speak.
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.
PROTOCOL_VERSION and MIN_PROTOCOL_VERSION lived in pybricks-core, and
the client and the service read them from there. Each package requires
pybricks-core at a minimum version with no maximum, so an older client
or service installed beside a newer pybricks-core read the newer number
and claimed a protocol it did not implement, which the handshake cannot
catch. That happened installing pybricks-cli 1.0.0b2 from a stale index:
pybricks-core 1.0.0b2 with pybricks-client 1.0.0b1 and pybricks-service
1.0.0b2, all saying protocol 4.
The version is a promise about behaviour, so it belongs to the code
that behaves. pb-client declares PROTOCOL_VERSION, the version it
speaks, in pb_client.service. pb-service declares PROTOCOL_VERSION and
MIN_PROTOCOL_VERSION, the versions it serves, in pb_service.methods.service,
with the rules for moving them. A test checks that the two agree.
Both are removed from pybricks-core, which is a breaking change, made
while the packages are in beta. pybricks-client 1.0.0b2 and
pybricks-service 1.0.0b3 import them from there, so either installed
beside a pybricks-core without them fails to import, rather than
claiming a protocol it does not speak.