Clean up guest connection states correctly when a collaborator disconnects

This bug was caught by running the executor until parked after tests.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-02-28 22:21:32 -08:00
parent c09921e790
commit 3788efeadf

View file

@ -296,7 +296,16 @@ impl Store {
}
}
Ok(e.remove())
let project = e.remove();
if let Some(share) = &project.share {
for guest_connection in share.guests.keys() {
if let Some(connection) = self.connections.get_mut(&guest_connection) {
connection.projects.remove(&project_id);
}
}
}
Ok(project)
} else {
Err(anyhow!("no such project"))?
}