Fix opening a buffer after leaving and joining the same project

This bug existed prior to #1700 and was caused by not clearing the
buffers that were already shared with a peer that left and opened
a project using the same connection. When such peer would re-join
the project and open a buffer that it had opened previously, the
host assumed the peer had already seen that buffer and wouldn't bother
sending it again.
This commit is contained in:
Antonio Scandurra 2022-10-12 10:28:17 +02:00
parent e24a69b838
commit 9adbab5d99
3 changed files with 49 additions and 6 deletions

View file

@ -4561,6 +4561,7 @@ impl Project {
buffer.update(cx, |buffer, cx| buffer.remove_peer(replica_id, cx));
}
}
this.shared_buffers.remove(&peer_id);
cx.emit(Event::CollaboratorLeft(peer_id));
cx.notify();