Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix test ensuring room is left when disconnected from LiveKit
Antonio Scandurraaa44de3d1674
diff --git a/crates/call/src/room.rs b/crates/call/src/room.rsindex f2d40b01290..8e2c38b3f8d 100644--- a/crates/call/src/room.rs+++ b/crates/call/src/room.rs@@ -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 {diff --git a/crates/collab/src/integration_tests.rs b/crates/collab/src/integration_tests.rsindex 6c773503bbf..0c26486667f 100644--- a/crates/collab/src/integration_tests.rs+++ b/crates/collab/src/integration_tests.rs@@ -492,7 +492,7 @@ async fn test_client_disconnecting_from_room(// to automatically leave the room.server.test_live_kit_server- .disconnect_client(client_b.peer_id().unwrap().to_string())+ .disconnect_client(client_b.user_id().unwrap().to_string()).await;deterministic.run_until_parked();active_call_a.update(cx_a, |call, _| assert!(call.room().is_none()));