Ensure declining call doesn't accidentally leave a room
This commit is contained in:
parent
88d2e2e277
commit
d6d1e20f07
2 changed files with 10 additions and 3 deletions
|
@ -6612,7 +6612,7 @@ impl TestClient {
|
||||||
.update(cx, |call, cx| call.share_project(project.clone(), cx))
|
.update(cx, |call, cx| call.share_project(project.clone(), cx))
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
log::error!("{}: error sharing project {:?}", username, error);
|
log::error!("{}: error sharing project, {:?}", username, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
let buffers = client.buffers.entry(project.clone()).or_default();
|
let buffers = client.buffers.entry(project.clone()).or_default();
|
||||||
|
|
|
@ -674,8 +674,13 @@ impl Store {
|
||||||
.connected_users
|
.connected_users
|
||||||
.get_mut(&recipient_user_id)
|
.get_mut(&recipient_user_id)
|
||||||
.ok_or_else(|| anyhow!("no such connection"))?;
|
.ok_or_else(|| anyhow!("no such connection"))?;
|
||||||
if let Some(active_call) = recipient.active_call.take() {
|
if let Some(active_call) = recipient.active_call {
|
||||||
anyhow::ensure!(active_call.room_id == room_id, "no such room");
|
anyhow::ensure!(active_call.room_id == room_id, "no such room");
|
||||||
|
anyhow::ensure!(
|
||||||
|
active_call.connection_id.is_none(),
|
||||||
|
"cannot decline a call after joining room"
|
||||||
|
);
|
||||||
|
recipient.active_call.take();
|
||||||
let recipient_connection_ids = self
|
let recipient_connection_ids = self
|
||||||
.connection_ids_for_user(recipient_user_id)
|
.connection_ids_for_user(recipient_user_id)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
@ -1196,7 +1201,9 @@ impl Store {
|
||||||
assert!(
|
assert!(
|
||||||
self.connections
|
self.connections
|
||||||
.contains_key(&ConnectionId(participant.peer_id)),
|
.contains_key(&ConnectionId(participant.peer_id)),
|
||||||
"room contains participant that has disconnected"
|
"room {} contains participant {:?} that has disconnected",
|
||||||
|
room_id,
|
||||||
|
participant
|
||||||
);
|
);
|
||||||
|
|
||||||
for participant_project in &participant.projects {
|
for participant_project in &participant.projects {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue