Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions tests/v12_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1357,15 +1357,12 @@ func TestMSC4311FullCreateEventOnStrippedState(t *testing.T) {
fmt.Sprintf("rooms.invite.%s.invite_state.events", client.GjsonEscape(roomID)),
)
must.NotEqual(t, len(inviteState.Array()), 0, "no events in invite_state")
// find the create event
// find the create event: MSC4311 requires it to be present, but clients
// still receive it in stripped state format (no extra fields)
Comment on lines +1360 to +1361
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think that there was a small error in TestMSC4311FullCreateEventOnStrippedState,

Yes, this test is flawed but there are two distinct pieces to MSC4311:

  1. Ensuring the m.room.create event is included in the client API (stripped state)
  2. Ensuring all state events in the federation API are using full PDU including the m.room.create which is required.

#796 fixes the second issue.

The first issue doesn't have a good test yet and I don't think this test is necessarily a "good" test. It looks like you've adapted what's here 👍 but it could be better. For example, even the test name here needs updating. And we could some of the same must.MatchGJSON(...) assertions here instead of these for loops. Also can be simplified to not use federation at all, etc, etc, etc.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, this is probably something we can tackle in #796

found := false
for _, ev := range inviteState.Array() {
if ev.Get("type").Str == spec.MRoomCreate {
found = true
// we should have extra fields
must.MatchGJSON(t, ev,
match.JSONKeyPresent("origin_server_ts"),
)
}
}
if !found {
Expand Down
Loading