Skip to content

Conversation

@sandhose
Copy link
Member

@sandhose sandhose commented Apr 1, 2025

This is similar to #1391, but it doesn't assert on the /send body response, and rather looks at events persisted through /sync and /events

@sandhose sandhose requested a review from a team as a code owner April 1, 2025 10:41
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

looks good overall, just checking some things

# be handled properly.
#
# This enforces that the entire transaction is rejected if a single bad PDU is
# sent. It is unclear if this is the correct behavior or not.
Copy link
Contributor

Choose a reason for hiding this comment

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

please fix comment ^^^

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 5359ab1

method => "GET",
uri => "/v3/rooms/$room_id/event/$event_id",
)->main::expect_m_not_found
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

That's an open question; the sending homeserver technically can't do anything with that information.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is why we don't yet assert on the /send response body

Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on. I'm curious if this test now fails for other homeserver implementations...

If it does, I suggest notifying the maintainers and adjusting the relevant test blacklist.

# be handled properly.
#
# This enforces that the entire transaction is rejected if a single bad PDU is
# sent. It is unclear if this is the correct behavior or not.
Copy link
Member

Choose a reason for hiding this comment

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

Could you update this comment as well? Perhaps say that the transaction should succeed, but it's unclear whether the response body should contain the invalid event.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 5359ab1 and in 842e5b7

Comment on lines +95 to +100
# Wait for the good event to be sent down through sync
await_sync_timeline_contains( $creator, $room_id, check => sub {
my ( $event ) = @_;
$event->{type} eq "m.room.message" &&
$event->{content}{body} eq "Good event"
})
Copy link
Member

Choose a reason for hiding this comment

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

Can we also check that we don't receive the bad event down sync?

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't find utilities to make sure that the sync timeline doesn't contain something :(

Copy link
Member

@anoadragon453 anoadragon453 Apr 1, 2025

Choose a reason for hiding this comment

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

Wouldn't it be just adding && $event->{content}{body} neq "Bad event"?

Copy link
Member Author

Choose a reason for hiding this comment

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

It only checks if one event in the timeline checks that constraint

@sandhose
Copy link
Member Author

sandhose commented Apr 1, 2025

I'm curious if this test now fails for other homeserver implementations...

Dendrite indeed fails. I've made implementation specific tests in a10eebc

Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

This LGTM other than potentially fixing the nit in #1399 (comment).

Dendrite appears to still be failing, as it's failing to find this test? https://github.com/matrix-org/sytest/actions/runs/14194392227/job/39766068369?pr=1399#step:6:9

@sandhose
Copy link
Member Author

sandhose commented Apr 1, 2025

@anoadragon453 fixed the test, that was a typo 7e2a47e

@sandhose sandhose merged commit 7ff7a31 into develop Apr 1, 2025
7 checks passed
@sandhose sandhose deleted the quenting/room-v6-bad-json branch April 1, 2025 12:10
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.

4 participants