Fix test ensuring room is left when disconnected from LiveKit

This commit is contained in:
Antonio Scandurra 2022-12-16 10:52:32 +01:00
parent ad37034960
commit aa44de3d16
2 changed files with 3 additions and 4 deletions

View file

@ -426,11 +426,9 @@ impl Room {
}
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) {
let Some(peer_id) = participant.peer_id else { continue };
this.participant_user_ids.insert(participant.user_id);
participant_peer_ids.insert(participant.user_id);
let old_projects = this
.remote_participants
@ -467,6 +465,7 @@ impl Room {
this.remote_participants.get_mut(&participant.user_id)
{
remote_participant.projects = participant.projects;
remote_participant.peer_id = peer_id;
if location != remote_participant.location {
remote_participant.location = location;
cx.emit(Event::ParticipantLocationChanged {
@ -500,7 +499,7 @@ impl Room {
}
this.remote_participants.retain(|user_id, participant| {
if participant_peer_ids.contains(user_id) {
if this.participant_user_ids.contains(user_id) {
true
} else {
for project in &participant.projects {