Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion lib/SyTest/Homeserver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ sub configure_logger

loggers => {
synapse => {
level => "INFO"
level => "DEBUG"
}
},

Expand Down
2 changes: 2 additions & 0 deletions tests/30rooms/06invite.pl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ sub inviteonly_room_fixture
)
}

push our @EXPORT, qw( inviteonly_room_fixture );

multi_test "Can invite users to invite-only rooms",
# TODO: deprecated endpoint used in this test
requires => do {
Expand Down
48 changes: 48 additions & 0 deletions tests/31sync/15lazy-members.pl
Original file line number Diff line number Diff line change
Expand Up @@ -807,3 +807,51 @@ sub check_filler_event {
Future->done(1);
});
};


test "Rejecing invite over federation doesn't break incremental /sync",
requires => [ remote_user_fixture(),
do {
my $creator = local_user_fixture();
$creator, inviteonly_room_fixture( creator => $creator );
}
],

check => sub {
my ( $invitee, $creator, $room_id ) = @_;

my ( $filter_id );

matrix_create_filter( $invitee, {
room => {
state => {
lazy_load_members => JSON::true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really require lazy loading? I'm not really sure I'm following that bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During lazy loading we pull out state a second time to get the membership event of the sender of the outlier event, so we stick lazy loading on to hit more of the /sync code paths

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

include_redundant_members => JSON::true,
},
timeline => {
limit => 10
},
}
})->then( sub {
( $filter_id ) = @_;

matrix_sync( $invitee, filter => $filter_id )
})->then( sub {
matrix_invite_user_to_room_synced( $creator, $invitee, $room_id )
})->then( sub {
matrix_leave_room_synced( $invitee, $room_id )
})->then( sub {
matrix_sync_again( $invitee, filter => $filter_id )
})->then( sub {
my ( $body ) = @_;

# Check that invitee no longer sees the invite

if( exists $body->{rooms} and exists $body->{rooms}{invite} ) {
assert_json_object( $body->{rooms}{invite} );
keys %{ $body->{rooms}{invite} } and die "Expected empty dictionary";
}

Future->done( 1 );
});
};