From aed317840fbde9ab25e3a9b35acc3a12aad8a34a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 10 Oct 2023 15:53:11 -0700 Subject: [PATCH] Fix inclusion of spurious views from other projects in FollowResponse (#3116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A logic error in https://github.com/zed-industries/zed/pull/2993 caused follow responses to sometimes contain extra views for other unshared projects 😱 . These views would generally fail to deserialize on the other end. This would create a broken intermediate state, where the following relationship was registered on the server (and on the leader's client), but the follower didn't have the state necessary for following into certain views. Release Notes: - Fixed a bug where following would sometimes fail if the leader had another unshared project open. --- crates/workspace/src/workspace.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 2aa9b008da5d617b10f67595a48f59687373b017..8d8b9046f67ec6941ffbcde06243de6e0bc74cca 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -2882,8 +2882,7 @@ impl Workspace { let cx = &cx; move |item| { let item = item.to_followable_item_handle(cx)?; - if project_id.is_some() - && project_id != follower_project_id + if (project_id.is_none() || project_id != follower_project_id) && item.is_project_item(cx) { return None;