Skip to content

Commit 0b7d990

Browse files
authored
Faster room joins: Fix bug in awaitPartialStateJoinCompletion (#487)
`/sync` is not a good way to wait for a room to transition to full state, since it only waits for the full state at particular events instead of the whole room. This caused flakiness in the "Device list updates no longer reach departed servers after partial state join completes" test. Use `/members` instead to wait for partial state joins to complete.
1 parent 0b0545b commit 0b7d990

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/federation_room_join_partial_state_test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ func TestPartialStateJoin(t *testing.T) {
121121
) {
122122
t.Helper()
123123

124-
user.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(user.UserID, room.RoomID))
124+
// Use a `/members` request to wait for the room to be un-partial stated.
125+
// We avoid using `/sync`, as it only waits (or used to wait) for full state at
126+
// particular events, rather than the whole room.
127+
user.MustDoFunc(
128+
t,
129+
"GET",
130+
[]string{"_matrix", "client", "v3", "rooms", room.RoomID, "members"},
131+
)
125132
t.Logf("%s's partial state join to %s completed.", user.UserID, room.RoomID)
126133
}
127134

0 commit comments

Comments
 (0)