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:
parent
c09921e790
commit
3788efeadf
1 changed files with 10 additions and 1 deletions
|
@ -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"))?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue