Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lazy-loading test which was looking for the wrong thing #1374

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions tests/31sync/15lazy-members.pl
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ sub check_filler_event {
# Ensure server has propagated those messages to Alice's sync stream
await_sync_timeline_contains( $alice, $room_id, check => check_filler_event( $bob->user_id, 10 ));
})->then( sub {
# Alice does an initial sync; this stashes the "next_batch" token for use below.
matrix_sync( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;
Expand All @@ -503,16 +504,23 @@ sub check_filler_event {
})->then( sub {
matrix_send_filler_messages_synced( $bob, $room_id, 5 );
})->then( sub {
# Make sure alice can see the filler messages. This starts with an initialsync, and doesn't update the "next batch".
await_sync_timeline_contains( $alice, $room_id, check => check_filler_event( $bob->user_id, 5 ));
})->then( sub {
# Finally, do an incremental sync, which should include all of the changes since the `matrix_sync` above
# (ie, before charlie left).
matrix_sync_again( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;

# XXX: i'm surprised we have an explicit state entry here at all,
# given the state transition is included in the timeline.
my $state = $body->{rooms}{join}{$room_id}{state}{events};
assert_state_room_members_match( $state, { $charlie->user_id => 'leave' });
log_if_fail "Incremental sync", $body;

# The timeline should include Charlie's leave event (followed by the 5 padding events).
my $room = $body->{rooms}{join}{$room_id};
my $event = $room->{timeline}{events}[0];

assert_eq( $event->{type}, "m.room.member" );
assert_eq( $event->{state_key}, $charlie->user_id );

Future->done(1);
});
Expand Down
Loading