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:
parent
3efb871cd4
commit
5523a510c5
6 changed files with 22 additions and 23 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -468,15 +468,7 @@ impl Database {
|
|||
Condition::all()
|
||||
.add(room_participant::Column::RoomId.eq(room_id))
|
||||
.add(room_participant::Column::UserId.eq(user_id))
|
||||
.add(room_participant::Column::AnsweringConnectionId.is_not_null())
|
||||
.add(
|
||||
Condition::any()
|
||||
.add(room_participant::Column::AnsweringConnectionLost.eq(true))
|
||||
.add(
|
||||
room_participant::Column::AnsweringConnectionServerId
|
||||
.ne(connection.owner_id as i32),
|
||||
),
|
||||
),
|
||||
.add(room_participant::Column::AnsweringConnectionId.is_not_null()),
|
||||
)
|
||||
.set(room_participant::ActiveModel {
|
||||
answering_connection_id: ActiveValue::set(Some(connection.id as i32)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue