Repository navigation
fix(TestIsDirectFlagFederation): Include m.room.create in invite state - #942
RasmusRendal wants to merge 1 commit into
Conversation
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>
53491a0 to
4dfa461
Compare
| }) | ||
| inviteReq, err := fclient.NewInviteV2Request(dmInviteEvent, []gomatrixserverlib.InviteStrippedState{}) | ||
| createEvent := room.Timeline[0] | ||
| inviteReq, err := fclient.NewInviteV2Request(dmInviteEvent, []gomatrixserverlib.InviteStrippedState{gomatrixserverlib.NewInviteStrippedState(createEvent)}) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
In MSC4311 and since spec version 1.16, invites are expected to contain the
m.room.createevent in theinvite_room_statefield.But the Complement test
TestIsDirectFlagFederationdoes not contain this event, causing Arminius to fail when checking for the event.This commit includes the create event in
invite_room_stateof the invite request.Pull Request Checklist