Skip to content

Commit

Permalink
Force upgrade people on nightly (#7744)
Browse files Browse the repository at this point in the history
Release Notes:

- N/A
  • Loading branch information
ConradIrwin authored Feb 13, 2024
1 parent e73e93f commit e9b95fd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion crates/collab/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ pub fn routes(server: Arc<Server>) -> Router<Body> {

pub async fn handle_websocket_request(
TypedHeader(ProtocolVersion(protocol_version)): TypedHeader<ProtocolVersion>,
_app_version_header: Option<TypedHeader<AppVersionHeader>>,
app_version_header: Option<TypedHeader<AppVersionHeader>>,
ConnectInfo(socket_address): ConnectInfo<SocketAddr>,
Extension(server): Extension<Arc<Server>>,
Extension(user): Extension<User>,
Expand All @@ -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;
Expand Down

0 comments on commit e9b95fd

Please sign in to comment.