Skip to content

Commit

Permalink
Fix "inbound federation redacts events from erased users"
Browse files Browse the repository at this point in the history
Ensure the HS under test remains in the room so we can query the event
which should be redacted.

Fixes #1203.
  • Loading branch information
David Robertson committed Mar 3, 2022
1 parent 5f4c26a commit e96c7d7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/50federation/32room-getevent.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,22 @@
requires => [
$main::OUTBOUND_CLIENT,
federated_rooms_fixture(),
local_user_fixture(),
],

# On the homeserver under test, have a user `creator` create a public room.
# A second user `remaining_user` on the same HS joins too.
# Sytest acts as a second homeserver and join a user (`user_id`) to that room.
# The `creator` sends a message, then requests deactivation with erasure.
# The homeserver under test should redact that event. Sytest confirms this by
# re-requesting that event. (The `remaining_user` ensures that the homeserver under
# test is still in the room.)

do => sub {
my ( $outbound_client, $creator, $user_id, $room ) = @_;
my ( $outbound_client, $creator, $user_id, $room, $remaining_user ) = @_;
my $first_home_server = $creator->server_name;
my $room_id = $room->room_id;
matrix_join_room($remaining_user, $room_id);

my $message_id;

Expand Down Expand Up @@ -79,7 +89,7 @@
# Check that the content is right
assert_eq( $event->{content}->{body}, "body1" );

# now do the erasure
# The `creator` requests that their account be deactivated.
matrix_deactivate_account( $creator, erase => JSON::true );
})->then( sub {
# re-fetch the event and check that it is redacted.
Expand Down

0 comments on commit e96c7d7

Please sign in to comment.