Allow reconnect before disconnect (#8684)

Co-Authored-By: Max <max@zed.dev>



Release Notes:

- Improved handling of reconnections during calls

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-03-01 15:41:32 -07:00 committed by GitHub
parent 3efb871cd4
commit 5523a510c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 22 additions and 23 deletions

View file

@ -161,11 +161,9 @@ impl Database {
// Find the collaborator record for this user's previous lost
// connection. Update it with the new connection id.
let server_id = ServerId(connection_id.owner_id as i32);
let Some(self_collaborator) = collaborators.iter_mut().find(|c| {
c.user_id == user_id
&& (c.connection_lost || c.connection_server_id != server_id)
}) else {
let Some(self_collaborator) =
collaborators.iter_mut().find(|c| c.user_id == user_id)
else {
log::info!("can't rejoin buffer, no previous collaborator found");
continue;
};