diff --git a/tests/31sync/15lazy-members.pl b/tests/31sync/15lazy-members.pl index c6473cee1..bd340c357 100644 --- a/tests/31sync/15lazy-members.pl +++ b/tests/31sync/15lazy-members.pl @@ -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 ); @@ -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); }); }; @@ -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. @@ -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 ], ]); @@ -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 @@ -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]; @@ -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). @@ -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 { @@ -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 @@ -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 ); @@ -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 ); @@ -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", @@ -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 ); @@ -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", @@ -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); }); };