From ec6117ac0c8055141ee3694b2bc2505e0fef451a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 22 Aug 2018 12:06:18 +0200 Subject: [PATCH 1/2] tests for LL dialect where you always LL yourself --- tests/31sync/15lazy-members.pl | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/31sync/15lazy-members.pl b/tests/31sync/15lazy-members.pl index 9e1ffebbd..b93c64fd1 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. @@ -161,7 +161,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 ]); matrix_send_room_text_message_synced( $charlie, $room_id, body => "Message from charlie", @@ -187,7 +187,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 @@ -232,7 +232,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]; @@ -271,11 +271,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 ); @@ -322,7 +322,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", @@ -354,11 +358,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 ); @@ -406,7 +410,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", @@ -419,7 +427,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); }); }; From 33a351ef58982972c97eb35349d0e89fa0e763bc Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 19 Sep 2018 16:14:09 +0100 Subject: [PATCH 2/2] more LL self fixes --- tests/31sync/15lazy-members.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/31sync/15lazy-members.pl b/tests/31sync/15lazy-members.pl index 9da15f9d4..bd340c357 100644 --- a/tests/31sync/15lazy-members.pl +++ b/tests/31sync/15lazy-members.pl @@ -286,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). @@ -329,7 +329,8 @@ })->then( sub { my ( $body ) = @_; assert_room_members( $body, $room_id, [ - $bob->user_id + $alice->user_id, + $bob->user_id, ]); repeat( sub { @@ -362,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 @@ -407,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 );