Skip to content

fix(TestIsDirectFlagFederation): Include m.room.create in invite state - #942

Open
RasmusRendal wants to merge 1 commit into
matrix-org:mainfrom
RasmusRendal:RasmusRendal/TestIsDirectFlagFederation_create_event
Open

RasmusRendal wants to merge 1 commit into
matrix-org:mainfrom
RasmusRendal:RasmusRendal/TestIsDirectFlagFederation_create_event

Conversation

@RasmusRendal

Copy link
Copy Markdown

In MSC4311 and since spec version 1.16, invites are expected to contain the m.room.create event in the invite_room_state field.

But the Complement test TestIsDirectFlagFederation does not contain this event, causing Arminius to fail when checking for the event.

This commit includes the create event in invite_room_state of the invite request.

Pull Request Checklist

@RasmusRendal
RasmusRendal requested review from a team as code owners October 27, 2026 08:31
@RasmusRendal
RasmusRendal requested review from erikjohnston and removed request for a team October 27, 2026 08:31
In MSC4311 and since spec version 1.16, invites are expected to contain
the `m.room.create` event in the `invite_room_state` field.

But the Complement test `TestIsDirectFlagFederation` does not contain
this event, causing Arminius to fail when checking for the event.

This commit includes the create event in `invite_room_state` of the
invite request.

Signed-off-by: Rasmus Rendal <r.kjaer@famedly.com>
@RasmusRendal
RasmusRendal force-pushed the RasmusRendal/TestIsDirectFlagFederation_create_event branch from 53491a0 to 4dfa461 Compare October 27, 2026 08:34
})
inviteReq, err := fclient.NewInviteV2Request(dmInviteEvent, []gomatrixserverlib.InviteStrippedState{})
createEvent := room.Timeline[0]
inviteReq, err := fclient.NewInviteV2Request(dmInviteEvent, []gomatrixserverlib.InviteStrippedState{gomatrixserverlib.NewInviteStrippedState(createEvent)})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So slight annoyance here, the spec does say that this should be a full event rather than a stripped event. This does work for now, but the ecosystem is meant to be moving towards requiring it to be the full event.

I'm not sure if it'd be easier to update NewInviteV2Request function or manually create the response

@RasmusRendal RasmusRendal Oct 27, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

My first intuition, without knowing much about gomatrixserverlib, is that fixing that seems like a better solution than duplicating its behaviour in Complement. I made a draft PR for it here, and it doesn't seem to be a super complicated change.

I ran this branch with the changes to gomatrixserverlib, and I just had to change the line to

inviteReq, err := fclient.NewInviteV2Request(dmInviteEvent, []gomatrixserverlib.PDU{createEvent})

which seems reasonable.

But I admittedly really don't know what I'm doing with go or gomatrixserverlib.

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.

2 participants