Skip to content

Commit

Permalink
Fix "... non-joined user can call /events on world_readable room" fla…
Browse files Browse the repository at this point in the history
…kes (#1346)

The test was flaking because it was sometimes waiting for events to come
down /events after they had already appeared in the stream.

Signed-off-by: Sean Quah <seanq@matrix.org>
  • Loading branch information
squahtx authored Mar 30, 2023
1 parent 0cbd088 commit 5727f78
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/30rooms/30history-visibility.pl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ sub test_history_visibility
matrix_set_room_history_visibility_synced( $user, $room_id, "world_readable" );
})->then( sub {
matrix_initialsync_room( $nonjoined_user, $room_id )
})->then( sub {
# Get a token and configure the waits for events below to start from it.
matrix_get_events( $nonjoined_user, room_id => $room_id, timeout => 0 )
->then( sub {
my ( $body ) = @_;
$nonjoined_user->eventstream_token = $body->{end};
});
})->then( sub {
Future->needs_all(
matrix_send_room_text_message_synced( $user, $room_id, body => "mice" )
Expand Down

0 comments on commit 5727f78

Please sign in to comment.