diff --git a/crates/voelin-core/src/link/tests.rs b/crates/voelin-core/src/link/tests.rs index e7f5526..9d37375 100644 --- a/crates/voelin-core/src/link/tests.rs +++ b/crates/voelin-core/src/link/tests.rs @@ -2236,16 +2236,21 @@ async fn the_features_of_a_server_are_the_hosts_narrowed_by_the_servers_list() { }) .await; - // The host narrows what it offers this user. + // The host narrows what it offers this user. A refusal counts only for a + // request made after the update: the earlier ones were answered by the host's + // wider set (or, before the server lifted its list, refused for that). let update = v1::HostUpdate { features: vec!["voice".into(), "chat".into()], limits: None }; handle.push(v1::Push { body: Some(v1::push::Body::HostUpdate(update)) }).unwrap(); + let after = request; within("the narrower set to apply", async { loop { request += 1; ask(request); tokio::time::sleep(Duration::from_millis(20)).await; while let Ok(event) = bus.try_recv() { - if refused(&event) { + if matches!(&event, Event::FileList { request, .. } if *request > after) + && refused(&event) + { return Some(()); } }