[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 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