From d7f56d6126fd93cfa59429894446b348a9dec6f0 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 6 Apr 2023 13:49:09 +0200 Subject: [PATCH] Forget which buffers were shared when host reconnects This fixes a bug where the host would momentarily disconnect and the guest would close and reopen the project. This would cause the host to not observe the guest closing the project. When the guest tried to open one of the buffers opened prior to closing the project, the host would not send them the buffer state because it would still remember that the buffer was shared. The `shared_buffers` map is now cleared when the host reconnects and will slowly get re-filled as guests issue `SynchronizeBuffers` requests. --- crates/project/src/project.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 88a187982c..19078f31d7 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -1081,6 +1081,7 @@ impl Project { message: proto::ResharedProject, cx: &mut ModelContext, ) -> Result<()> { + self.shared_buffers.clear(); self.set_collaborators_from_proto(message.collaborators, cx)?; let _ = self.metadata_changed(cx); Ok(())