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.
This commit is contained in:
Antonio Scandurra 2023-04-06 13:49:09 +02:00
parent bf3b8adf35
commit d7f56d6126

View file

@ -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(())