diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index 454ef34425..086465965b 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -864,7 +864,7 @@ pub fn routes(server: Arc) -> Router { pub async fn handle_websocket_request( TypedHeader(ProtocolVersion(protocol_version)): TypedHeader, - _app_version_header: Option>, + app_version_header: Option>, ConnectInfo(socket_address): ConnectInfo, Extension(server): Extension>, Extension(user): Extension, @@ -879,6 +879,19 @@ pub async fn handle_websocket_request( .into_response(); } + // the first version of zed that sent this header was 0.121.x + if let Some(version) = app_version_header.map(|header| header.0 .0) { + // 0.123.0 was a nightly version with incompatible collab changes + // that were reverted. + if version == "0.123.0".parse().unwrap() { + return ( + StatusCode::UPGRADE_REQUIRED, + "client must be upgraded".to_string(), + ) + .into_response(); + } + } + let socket_address = socket_address.to_string(); ws.on_upgrade(move |socket| { use util::ResultExt;