Repository navigation
Disconnect when the server picks an unsupported protocol version - #316
Open
jaeminbird wants to merge 1 commit into
Open
jaeminbird wants to merge 1 commit into
jaeminbird wants to merge 1 commit into
Conversation
The lifecycle spec says a client that does not support the protocol version in the server's initialize response should disconnect. The client stored any version the server returned and finished the handshake with notifications/initialized. Check the version against Version.supported, and on a mismatch disconnect and throw instead of sending notifications/initialized.
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.
Motivation and Context
The lifecycle spec says a client that doesn't support the version in the server's initialize response SHOULD disconnect. The client accepts any version and sends
notifications/initialized. It now checksVersion.supportedand, on a mismatch, disconnects and throws, as the TypeScript and Python SDKs do.How Has This Been Tested?
A new ClientTest has the server answer with
1999-01-01and asserts thatconnectthrows,notifications/initializedis never sent, and the transport is disconnected; it fails on main and passes with the fix. Fullswift testpasses on Linux (Swift 6.1).Breaking Changes
A client talking to a server that answers with an unsupported version now fails to connect instead of continuing.
Types of changes
Checklist
Additional context
The check applies in strict and non-strict mode, since the spec says SHOULD and the reference SDKs always disconnect.