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

Test for not kicking users who aren't in a room #602

Merged
merged 4 commits into from
Apr 4, 2019

Conversation

anoadragon453
Copy link
Member

$body->{membership} eq "leave" or
die "Expected kicked user membership to be 'leave'";

retry_until_success {
Copy link
Member

Choose a reason for hiding this comment

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

You probably want the retry_until_success to cover the checking of the room state, rather than the kicking

type => "m.room.member",
state_key => $kicked_user->user_id,
)
}
Copy link
Member

Choose a reason for hiding this comment

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

This will always succeed, as it will either return the join or the leave. I'd add

)->then( sub {
   my ( $body ) = @_;
   $body->{membership} eq "leave" or die "";

   Future->done ( 1 );
})

in the retry loop too

@anoadragon453 anoadragon453 merged commit 84a9856 into develop Apr 4, 2019
@anoadragon453 anoadragon453 deleted the anoa/no_kick_not_in_room branch April 4, 2019 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants