Forget which buffers were shared when host reconnects

Antonio Scandurra created

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.

Change summary

crates/project/src/project.rs | 1 +
1 file changed, 1 insertion(+)

Detailed changes

crates/project/src/project.rs 🔗

@@ -1081,6 +1081,7 @@ impl Project {
         message: proto::ResharedProject,
         cx: &mut ModelContext<Self>,
     ) -> Result<()> {
+        self.shared_buffers.clear();
         self.set_collaborators_from_proto(message.collaborators, cx)?;
         let _ = self.metadata_changed(cx);
         Ok(())