diff --git a/common/client-libs/gateway-client/src/client.rs b/common/client-libs/gateway-client/src/client.rs index 3bd5bbf19b..1bd98498bb 100644 --- a/common/client-libs/gateway-client/src/client.rs +++ b/common/client-libs/gateway-client/src/client.rs @@ -408,18 +408,24 @@ impl GatewayClient { ) -> Result<(), GatewayClientError> { // right now there are no failure cases here, but this might change in the future match gateway_protocol { - Some(v) if v == PROTOCOL_VERSION => { - info!("the gateway is using exactly the same protocol version as we are. We're good to continue!"); + None => { + warn!("the gateway we're connected to has not specified its protocol version. It's probably running version < 1.1.X, but that's still fine for now. It will become a hard error in 1.2.0"); + // note: in +1.2.0 we will have to return a hard error here Ok(()) } - v => { + Some(v) if v != PROTOCOL_VERSION => { let err = GatewayClientError::IncompatibleProtocol { - gateway: v, + gateway: Some(v), current: PROTOCOL_VERSION, }; error!("{err}"); Err(err) } + + Some(_) => { + info!("the gateway is using exactly the same protocol version as we are. We're good to continue!"); + Ok(()) + } } } diff --git a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs index 0e4c8dd978..4d4528b208 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs @@ -348,18 +348,24 @@ where ) -> Result<(), InitialAuthenticationError> { // right now there are no failure cases here, but this might change in the future match client_protocol { - Some(v) if v == PROTOCOL_VERSION => { - info!("the client is using exactly the same protocol version as we are. We're good to continue!"); + None => { + warn!("the client we're connected to has not specified its protocol version. It's probably running version < 1.1.X, but that's still fine for now. It will become a hard error in 1.2.0"); + // note: in +1.2.0 we will have to return a hard error here Ok(()) } - v => { + Some(v) if v != PROTOCOL_VERSION => { let err = InitialAuthenticationError::IncompatibleProtocol { - client: v, + client: Some(v), current: PROTOCOL_VERSION, }; error!("{err}"); Err(err) } + + Some(_) => { + info!("the client is using exactly the same protocol version as we are. We're good to continue!"); + Ok(()) + } } }