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:
1 parent
45e85d6010
commit
29edf2691a
1 file changed
+10
-1
@@ -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"))?
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user