Skip to content

Commit 3f2584b

Browse files
author
David Robertson
authored
Fix "inbound federation redacts events from erased users" (#1205)
Ensure the HS under test remains in the room so we can query the event which should be redacted. Fixes #1203.
1 parent 46b292d commit 3f2584b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/50federation/32room-getevent.pl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,22 @@
4545
requires => [
4646
$main::OUTBOUND_CLIENT,
4747
federated_rooms_fixture(),
48+
local_user_fixture(),
4849
],
4950

51+
# On the homeserver under test, have a user `creator` create a public room.
52+
# A second user `remaining_user` on the same HS joins too.
53+
# Sytest acts as a second homeserver and join a user (`user_id`) to that room.
54+
# The `creator` sends a message, then requests deactivation with erasure.
55+
# The homeserver under test should redact that event. Sytest confirms this by
56+
# re-requesting that event. (The `remaining_user` ensures that the homeserver under
57+
# test is still in the room.)
58+
5059
do => sub {
51-
my ( $outbound_client, $creator, $user_id, $room ) = @_;
60+
my ( $outbound_client, $creator, $user_id, $room, $remaining_user ) = @_;
5261
my $first_home_server = $creator->server_name;
5362
my $room_id = $room->room_id;
63+
matrix_join_room($remaining_user, $room_id);
5464

5565
my $message_id;
5666

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

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

0 commit comments

Comments
 (0)