fix(rooms): start a room's roster from the member list, not the join echo

soulfind tells a room about a new member, the new member included, before
it sends them the room's member list. The roster was started from that
echo, so for a moment after joining a room read as holding nobody but us,
and `room users` returns on the first roster it sees: it could print only
the asking user. That is the flake in room_users_lists_who_is_in_the_room.

A join or leave now only updates a roster the server has sent in full,
which is also what room_members already promised for a room we have not
joined. The e2e test waits for the resident's own member list instead of a
fixed second, so it no longer races the resident's join either.
This commit is contained in:
Michel de Graaf
2026-09-10 13:59:04 +02:00
parent e39427ada5
commit 7060d3521a
3 changed files with 30 additions and 4 deletions
+6 -1
View File
@@ -2418,7 +2418,12 @@ fn room_users_lists_who_is_in_the_room() {
let server = server_or_skip!();
let resident = server.client("cli_e2e_resident", Vec::new());
resident.join_room("cli_e2e_roster").expect("join");
settle();
// The member list reaches the resident once the server has them in.
let deadline = Instant::now() + Duration::from_secs(10);
while resident.room_members("cli_e2e_roster").is_empty() {
assert!(Instant::now() < deadline, "the resident never got in");
std::thread::sleep(Duration::from_millis(50));
}
let output = cli(
&server,