Skip to content

Commit

Permalink
Drop invalid PDUs instead of erroring. Implements element-hq/synapse#…
Browse files Browse the repository at this point in the history
…7543

Signed-off-by: morguldir <[email protected]>
  • Loading branch information
morguldir committed Dec 12, 2024
1 parent c678954 commit c097eb1
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions tests/50federation/51transactions.pl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@

my $room = $rooms[0];

my $first_event = $room->create_and_insert_event(
type => "m.room.message",

sender => $user_id,
content => {
body => "Message 1",
},
);
my $bad_event = $room->create_and_insert_event(
type => "m.room.message",

Expand All @@ -75,11 +83,25 @@
},
);

my @pdus = ( $bad_event );
my $third_event = $room->create_and_insert_event(
type => "m.room.message",

sender => $user_id,
content => {
body => "Message 1",
},
);

my @pdus = ( $first_event, $bad_event, $third_event );
print "meowwo";
print @pdus;

# Send the transaction to the client and expect a fail
$outbound_client->send_transaction(
pdus => \@pdus,
destination => $creator->server_name,
)->main::expect_m_bad_json;
)->then( sub {
my ( $body ) = @_;
assert_json_keys( $body->{pdus}, map { $room->id_for_event( $_ ) } @pdus[0, 2] )
});
};

0 comments on commit c097eb1

Please sign in to comment.