[Fix] no block on client closing

This commit is contained in:
Alex Emmet 2026-04-09 20:09:32 +02:00
commit 65ec3941b3

View file

@ -102,9 +102,13 @@ impl RhoConnection {
let target_user_id = connection.get_user_id().await; let target_user_id = connection.get_user_id().await;
{ {
let mut connections = self.client_connections.write().await; let mut connections = self.client_connections.write().await;
connections.retain(|con| { let mut keep = Vec::new();
futures::executor::block_on(async { con.get_user_id().await != target_user_id }) for con in connections.drain(..) {
}); if con.get_user_id().await != target_user_id {
keep.push(con);
}
}
*connections = keep;
} }
// Notify OmegaConnection // Notify OmegaConnection