Cancel pending call when participant leaves room after a reconnection
Previously, if a user temporarily disconnected while there was a pending call, we would fail to cancel such pending call when the caller left the room. This was due to the caller reconnecting and having a different connection id than the one originally used to initiate the call.
This commit is contained in:
parent
a4d9d6c750
commit
74aeec360d
2 changed files with 6 additions and 12 deletions
|
@ -1586,12 +1586,8 @@ impl Database {
|
||||||
.filter(
|
.filter(
|
||||||
Condition::all()
|
Condition::all()
|
||||||
.add(
|
.add(
|
||||||
room_participant::Column::CallingConnectionId
|
room_participant::Column::CallingUserId
|
||||||
.eq(connection.id as i32),
|
.eq(leaving_participant.user_id),
|
||||||
)
|
|
||||||
.add(
|
|
||||||
room_participant::Column::CallingConnectionServerId
|
|
||||||
.eq(connection.owner_id as i32),
|
|
||||||
)
|
)
|
||||||
.add(room_participant::Column::AnsweringConnectionId.is_null()),
|
.add(room_participant::Column::AnsweringConnectionId.is_null()),
|
||||||
)
|
)
|
||||||
|
|
|
@ -166,12 +166,10 @@ async fn test_random_collaboration(
|
||||||
let contacts = server.app_state.db.get_contacts(*user_id).await.unwrap();
|
let contacts = server.app_state.db.get_contacts(*user_id).await.unwrap();
|
||||||
let pool = server.connection_pool.lock();
|
let pool = server.connection_pool.lock();
|
||||||
for contact in contacts {
|
for contact in contacts {
|
||||||
if let db::Contact::Accepted { user_id, .. } = contact {
|
if let db::Contact::Accepted { user_id, busy, .. } = contact {
|
||||||
if pool.is_user_online(user_id) {
|
if user_id == removed_user_id {
|
||||||
assert_ne!(
|
assert!(!pool.is_user_online(user_id));
|
||||||
user_id, removed_user_id,
|
assert!(!busy);
|
||||||
"removed client is still a contact of another peer"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue