Fix test ensuring room is left when disconnected from LiveKit
This commit is contained in:
parent
ad37034960
commit
aa44de3d16
2 changed files with 3 additions and 4 deletions
|
@ -426,11 +426,9 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(participants) = remote_participants.log_err() {
|
if let Some(participants) = remote_participants.log_err() {
|
||||||
let mut participant_peer_ids = HashSet::default();
|
|
||||||
for (participant, user) in room.participants.into_iter().zip(participants) {
|
for (participant, user) in room.participants.into_iter().zip(participants) {
|
||||||
let Some(peer_id) = participant.peer_id else { continue };
|
let Some(peer_id) = participant.peer_id else { continue };
|
||||||
this.participant_user_ids.insert(participant.user_id);
|
this.participant_user_ids.insert(participant.user_id);
|
||||||
participant_peer_ids.insert(participant.user_id);
|
|
||||||
|
|
||||||
let old_projects = this
|
let old_projects = this
|
||||||
.remote_participants
|
.remote_participants
|
||||||
|
@ -467,6 +465,7 @@ impl Room {
|
||||||
this.remote_participants.get_mut(&participant.user_id)
|
this.remote_participants.get_mut(&participant.user_id)
|
||||||
{
|
{
|
||||||
remote_participant.projects = participant.projects;
|
remote_participant.projects = participant.projects;
|
||||||
|
remote_participant.peer_id = peer_id;
|
||||||
if location != remote_participant.location {
|
if location != remote_participant.location {
|
||||||
remote_participant.location = location;
|
remote_participant.location = location;
|
||||||
cx.emit(Event::ParticipantLocationChanged {
|
cx.emit(Event::ParticipantLocationChanged {
|
||||||
|
@ -500,7 +499,7 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remote_participants.retain(|user_id, participant| {
|
this.remote_participants.retain(|user_id, participant| {
|
||||||
if participant_peer_ids.contains(user_id) {
|
if this.participant_user_ids.contains(user_id) {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
for project in &participant.projects {
|
for project in &participant.projects {
|
||||||
|
|
|
@ -492,7 +492,7 @@ async fn test_client_disconnecting_from_room(
|
||||||
// to automatically leave the room.
|
// to automatically leave the room.
|
||||||
server
|
server
|
||||||
.test_live_kit_server
|
.test_live_kit_server
|
||||||
.disconnect_client(client_b.peer_id().unwrap().to_string())
|
.disconnect_client(client_b.user_id().unwrap().to_string())
|
||||||
.await;
|
.await;
|
||||||
deterministic.run_until_parked();
|
deterministic.run_until_parked();
|
||||||
active_call_a.update(cx_a, |call, _| assert!(call.room().is_none()));
|
active_call_a.update(cx_a, |call, _| assert!(call.room().is_none()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue