Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Avoid applying outdated UpdateProject methods after rejoining a room
Max Brunsfeld1159f5517b6a
diff --git a/crates/call/src/room.rs b/crates/call/src/room.rsindex eeb8a6a5d88..70d70218f32 100644--- a/crates/call/src/room.rs+++ b/crates/call/src/room.rs@@ -424,7 +424,7 @@ impl Room {false});- let response = self.client.request(proto::RejoinRoom {+ let response = self.client.request_envelope(proto::RejoinRoom {id: self.id,reshared_projects,rejoined_projects,@@ -432,6 +432,8 @@ impl Room {cx.spawn(|this, mut cx| async move {let response = response.await?;+ let message_id = response.message_id;+ let response = response.payload;let room_proto = response.room.ok_or_else(|| anyhow!("invalid room"))?;this.update(&mut cx, |this, cx| {this.status = RoomStatus::Online;@@ -448,7 +450,7 @@ impl Room {for rejoined_project in response.rejoined_projects {if let Some(project) = projects.get(&rejoined_project.id) {project.update(cx, |project, cx| {- project.rejoined(rejoined_project, cx).log_err();+ project.rejoined(rejoined_project, message_id, cx).log_err();});}}diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 1e9721339f0..3e5a4500756 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -1089,8 +1089,10 @@ impl Project {pub fn rejoined(&mut self,message: proto::RejoinedProject,+ message_id: u32,cx: &mut ModelContext<Self>,) -> Result<()> {+ self.join_project_response_message_id = message_id;self.set_worktrees_from_proto(message.worktrees, cx)?;self.set_collaborators_from_proto(message.collaborators, cx)?;self.language_server_statuses = message