Match guest's reported buffers on host when synchronizing after reconnect

Antonio Scandurra and Nathan Sobo created

If the host thinks a guest has a buffer that they don't have, the host won't
send it to them when they attempt to open it the next time. This can happen
if the guest disconnected before they received the host's response to an
initial open buffer request.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

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

Detailed changes

crates/project/src/project.rs 🔗

@@ -5181,6 +5181,7 @@ impl Project {
                 return;
             };
 
+            this.shared_buffers.entry(guest_id).or_default().clear();
             for buffer in envelope.payload.buffers {
                 let buffer_id = buffer.id;
                 let remote_version = language::proto::deserialize_version(buffer.version);