Skip to content
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
47 changes: 31 additions & 16 deletions tests/31sync/15lazy-members.pl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Bob sends 10 events into it
# Charlie sends 10 events into it
# Alice syncs with a filter on the last 10 events, and lazy loaded members
# She should only see Charlie in the membership list.
# She should only see Charlie in the membership list (and herself)

my ( $filter_id, $room_id, $event_id_1, $event_id_2 );

Expand Down Expand Up @@ -102,7 +102,7 @@
matrix_sync( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;
assert_room_members ( $body, $room_id, [ $charlie->user_id ]);
assert_room_members ( $body, $room_id, [ $alice->user_id, $charlie->user_id ]);
Future->done(1);
});
};
Expand All @@ -119,7 +119,7 @@
# Bob and Charlie join.
# Bob sends 10 events into it
# Alice syncs with a filter on the last 10 events, and lazy loaded members
# Alice should see only Bob in the membership list.
# Alice should see only Bob in the membership list (and herself).
# Charlie sends an event
# Alice syncs again; she should only see Charlie's membership event
# in the incremental sync as Charlie sent anything in this timeframe.
Expand Down Expand Up @@ -169,6 +169,7 @@
[ 'm.room.power_levels', '' ],
[ 'm.room.name', '' ],
[ 'm.room.history_visibility', '' ],
[ 'm.room.member', $alice->user_id ],
[ 'm.room.member', $bob->user_id ],
]);

Expand Down Expand Up @@ -202,7 +203,7 @@
# Bob and Charlie and Dave join.
# Bob sends 10 events into it
# Alice syncs with a filter on the last 10 events, and lazy loaded members
# Alice should see only Bob in the membership list.
# Alice should see only Bob in the membership list (and herself).
# Charlie then sends 10 events
# Dave then sends 10 events
# Alice syncs again; she should get a gappy sync and only see
Expand Down Expand Up @@ -247,7 +248,7 @@
matrix_sync( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;
assert_room_members( $body, $room_id, [ $bob->user_id ]);
assert_room_members( $body, $room_id, [ $alice->user_id, $bob->user_id ]);

repeat( sub {
my $msgnum = $_[0];
Expand Down Expand Up @@ -285,7 +286,7 @@
# Bob and Charlie join.
# Bob sends 10 events into it
# Alice initial syncs with a filter on the last 10 events, and LL members
# Alice should see only Bob in the membership list.
# Alice should see only Bob in the membership list (and herself)
# Charlie then sends 10 events
# Alice syncs again; she should get a gappy sync and see
# Charlie's membership (due to his timeline events).
Expand Down Expand Up @@ -328,7 +329,8 @@
})->then( sub {
my ( $body ) = @_;
assert_room_members( $body, $room_id, [
$bob->user_id
$alice->user_id,
$bob->user_id,
]);

repeat( sub {
Expand Down Expand Up @@ -361,7 +363,7 @@
# Bob and Charlie join.
# Bob sends 10 events into it
# Alice initial syncs with a filter on the last 10 events, and LL members
# Alice should see only Bob in the membership list.
# Alice should see only Bob in the membership list (and herself)
# Dave joins
# Charlie then sends 10 events
# Alice syncs again; she should get a gappy sync and see both
Expand Down Expand Up @@ -406,7 +408,8 @@
})->then( sub {
my ( $body ) = @_;
assert_room_members( $body, $room_id, [
$bob->user_id
$alice->user_id,
$bob->user_id,
]);

matrix_join_room( $dave, $room_id );
Expand Down Expand Up @@ -443,11 +446,11 @@
# Bob sends 10 events into it
# Charlie sends 5 events into it
# Alice syncs with a filter on the last 10 events, and lazy loaded members
# Alice should see only Bob and Charlie in the membership list.
# Alice should see only Bob and Charlie in the membership list (and herself).
# Bob sends 1 more event
# Charlie sends 1 more event
# Alice syncs again; she should not see any membership events as
# the redundant ones for Bob and Charlie are removed.
# the redundant ones for Bob and Charlie are removed

my ( $filter_id, $room_id, $event_id_1, $event_id_2 );

Expand Down Expand Up @@ -494,7 +497,11 @@
matrix_sync( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;
assert_room_members( $body, $room_id, [ $bob->user_id, $charlie->user_id ]);
assert_room_members( $body, $room_id, [
$alice->user_id,
$bob->user_id,
$charlie->user_id
]);

matrix_send_room_text_message_synced( $bob, $room_id,
body => "New message from bob",
Expand Down Expand Up @@ -526,11 +533,11 @@
# Charlie sends 5 events into it
# Alice syncs with a filter on the last 10 events, and lazy loaded members
# and include_redundant_members
# Alice should see only Bob and Charlie in the membership list.
# Alice should see only Bob and Charlie in the membership list (and herself)
# Bob sends 1 more event
# Charlie sends 1 more event
# Alice syncs again; she should see redundant membership events for Bob and
# Charlie again
# Charlie again (and herself)

my ( $filter_id, $room_id, $event_id_1, $event_id_2 );

Expand Down Expand Up @@ -578,7 +585,11 @@
matrix_sync( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;
assert_room_members( $body, $room_id, [ $bob->user_id, $charlie->user_id ]);
assert_room_members( $body, $room_id, [
$alice->user_id,
$bob->user_id,
$charlie->user_id
]);

matrix_send_room_text_message( $bob, $room_id,
body => "New message from bob",
Expand All @@ -591,7 +602,11 @@
matrix_sync_again( $alice, filter => $filter_id );
})->then( sub {
my ( $body ) = @_;
assert_room_members( $body, $room_id, [ $bob->user_id, $charlie->user_id ]);
assert_room_members( $body, $room_id, [
$alice->user_id,
$bob->user_id,
$charlie->user_id
]);
Future->done(1);
});
};