Skip to content

Commit

Permalink
Fix 'Events come down the correct room' (#1057)
Browse files Browse the repository at this point in the history
In particular, now that we have multiple event persisters there is no
guarentee of order things come down /sync.
  • Loading branch information
erikjohnston authored Jun 8, 2021
1 parent 4c80d2c commit eedac42
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/90jira/SYN-627.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,27 @@
})->then( sub {
matrix_sync( $user );
})->then( sub {
# send messages into all but the last room.
Future->needs_all( map {
my $room_id = $_;

matrix_send_room_text_message( $user, $room_id, body => "$room_id" );
} @rooms[0 .. @rooms - 2] );
} @rooms );
})->then( sub {
# send a message into the last room
matrix_send_room_text_message_synced( $user, $rooms[-1], body => $rooms[-1] );
# Wait until we see all rooms come down the sync stream.
retry_until_success {
matrix_sync(
$user, since => $user->sync_next_batch, update_next_batch => 0
)->then( sub {
my ( $body ) = @_;

foreach my $room_id ( @rooms ) {
my $room = $body->{rooms}{join}{$room_id};

assert_json_keys( $room, qw( timeline ));
@{ $room->{timeline}{events} } == 1 or die "Expected exactly one event";
}
})
}
})->then( sub {
matrix_sync_again( $user );
})->then( sub {
Expand Down

0 comments on commit eedac42

Please sign in to comment.