From 65ec3941b36243d36d819e599b3421d6e285952c Mon Sep 17 00:00:00 2001 From: Alex Emmet <111742636+Alex-Emmet@users.noreply.github.com> Date: Thu, 9 Apr 2026 20:09:32 +0200 Subject: [PATCH] [Fix] no block on client closing --- src/rho/rho_connection.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rho/rho_connection.rs b/src/rho/rho_connection.rs index 6a740ff..2a30430 100644 --- a/src/rho/rho_connection.rs +++ b/src/rho/rho_connection.rs @@ -102,9 +102,13 @@ impl RhoConnection { let target_user_id = connection.get_user_id().await; { let mut connections = self.client_connections.write().await; - connections.retain(|con| { - futures::executor::block_on(async { con.get_user_id().await != target_user_id }) - }); + let mut keep = Vec::new(); + for con in connections.drain(..) { + if con.get_user_id().await != target_user_id { + keep.push(con); + } + } + *connections = keep; } // Notify OmegaConnection