File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1818 RiverException ,
1919)
2020from replit_river .messages import (
21- PROTOCOL_VERSION ,
21+ CLIENT_PROTOCOL_VERSION ,
2222 FailedSendingMessageException ,
2323 WebsocketClosedException ,
2424 parse_transport_msg ,
@@ -227,7 +227,7 @@ async def _send_handshake_request(
227227 ) -> ControlMessageHandshakeRequest [HandshakeMetadataType ]:
228228 handshake_request = ControlMessageHandshakeRequest [HandshakeMetadataType ](
229229 type = "HANDSHAKE_REQ" ,
230- protocolVersion = PROTOCOL_VERSION ,
230+ protocolVersion = CLIENT_PROTOCOL_VERSION ,
231231 sessionId = session_id ,
232232 metadata = handshake_metadata ,
233233 expectedSessionState = expected_session_state ,
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class FailedSendingMessageException(Exception):
2929 pass
3030
3131
32- PROTOCOL_VERSION = "v1.1"
32+ CLIENT_PROTOCOL_VERSION = "v2.0"
33+ SERVER_PROTOCOL_VERSION = "v1.1"
3334
3435
3536async def send_transport_message (
Original file line number Diff line number Diff line change 1010from websockets .exceptions import ConnectionClosed
1111
1212from replit_river .messages import (
13- PROTOCOL_VERSION ,
13+ SERVER_PROTOCOL_VERSION ,
1414 FailedSendingMessageException ,
1515 WebsocketClosedException ,
1616 parse_transport_msg ,
@@ -209,15 +209,15 @@ async def _establish_handshake(
209209 )
210210 raise InvalidMessageException ("failed validate handshake request" ) from e
211211
212- if handshake_request .protocolVersion != PROTOCOL_VERSION :
212+ if handshake_request .protocolVersion != SERVER_PROTOCOL_VERSION :
213213 await self ._send_handshake_response (
214214 request_message ,
215215 HandShakeStatus (ok = False , reason = "protocol version mismatch" ),
216216 websocket ,
217217 )
218218 error_str = (
219219 "protocol version mismatch: "
220- + f"{ handshake_request .protocolVersion } != { PROTOCOL_VERSION } "
220+ + f"{ handshake_request .protocolVersion } != { SERVER_PROTOCOL_VERSION } "
221221 )
222222 raise InvalidMessageException (error_str )
223223 if request_message .to != self ._transport_id :
You can’t perform that action at this time.
0 commit comments