Skip to content

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Aug 1, 2025

This was spawned by the discussion in matrix-org/matrix-spec#2181.

Server Implementations:

Most clients already rely on being able to access the m.room.member events of the knock or invite process, and of the inviter.

The following client implementations also rely on being able to access the origin_server_ts:

Rendered

zecakeh added 2 commits August 1, 2025 16:07
Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh changed the title MSCXXXX: Non-stripped room member event in stripped state MSC4319: Non-stripped room member event in stripped state Aug 1, 2025
Signed-off-by: Kévin Commaille <[email protected]>
@tulir tulir added proposal A matrix spec change proposal client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec labels Aug 1, 2025
Comment on lines 31 to 36
The `m.room.member` event that was created during the invite or knock process MUST be present in
the `events` of the `invite_state` or `knock_state`. Since servers have access to the whole event,
and for clients to be able to access the time of the event via the `origin_server_ts` field, it
MUST use the same format as can be found in the `events` of `timeline` and `state` for rooms under
`join`. This is the format currently defined as
[`ClientEventWithoutRoomID`](https://spec.matrix.org/v1.15/client-server-api/#get_matrixclientv3sync_response-200_clienteventwithoutroomid).
Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, because clients want access to the origin_server_ts and generally speaking we don't want different formats for data in a list, this MSC could do two things:

  1. Add origin_server_ts to all stripped state events
  2. Add the inviting m.room.member event to the list of suggested state

Copy link
Contributor Author

@zecakeh zecakeh Aug 11, 2025

Choose a reason for hiding this comment

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

I also found a use case for accessing unsigned of an invite m.room.member event, for clients to be able to know if the invite is after a knock by looking into the prev_content.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not seeing why that would be important to them, or why that needs to come from unsigned instead of somewhere else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To auto-accept an invite following a knock for example. If it's a new device there is no other place where this information can be found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the stripped state event format to include origin_server_ts and unsigned (since this one is already optional in other event formats anyway).

@zecakeh zecakeh changed the title MSC4319: Non-stripped room member event in stripped state MSC4319: Room member events in stripped state Aug 30, 2025
display information about the sender of an invite, like their display name or avatar.


## Potential issues
Copy link
Contributor

@Gnuxie Gnuxie Sep 8, 2025

Choose a reason for hiding this comment

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

Clients have depended on synapse's behaviour of including the full client formatted event for the m.room.member invite event.

the-draupnir-project/Draupnir#945

In draupnir this dependency is more than just a parsing issue. The matrix-protection-suite provides a handle called handleExternalMembership which invitations are fed into from the matrix-protection-suite's conception of the timeline, which is closer to appservice push than /sync. As appservice push also pushed invitations this way.

Deduplication and buffering is then coordinated using the event id as it is identical to any other client formatted event and not special cased. So this is a deep dependency.

https://github.com/Gnuxie/matrix-protection-suite/blob/a85102c0aaa6ba73beae8fdb35600eec0999eada/src/Protection/Protection.ts#L176
https://github.com/the-draupnir-project/Draupnir/blob/main/src/protections/invitation/JoinRoomsOnInviteProtection.tsx#L86-L96
https://github.com/the-draupnir-project/Draupnir/blob/f1dad52288ff32a096cbd3ff5be110648574c51f/src/Draupnir.ts#L355
https://github.com/Gnuxie/matrix-protection-suite/blob/453e55b182282aad59db430f53549d89541a8e21/src/ClientManagement/StandardClientRooms.ts#L95-L126
https://github.com/the-draupnir-project/Draupnir/blob/f1dad52288ff32a096cbd3ff5be110648574c51f/src/DraupnirBotMode.ts#L97-L99
https://github.com/the-draupnir-project/Draupnir/blob/f1dad52288ff32a096cbd3ff5be110648574c51f/src/appservice/AppService.ts#L355

display information about the sender of an invite, like their display name or avatar.


## Potential issues
Copy link
Contributor

Choose a reason for hiding this comment

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

The change complicates clients that allow either /sync or appservice push to be their event source. Since now invitations sourced from /sync will be a different format to those provided in appservice push. See #4319 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

Additionally, the appservice event can't be stripped, because then you'd have two different data formats in the events array of /transactions

In this specific context, the AS API is closer to S-S than C-S /sync, as both AS and S-S send full invite events with stripped state in unsigned -> invite_room_state, while /sync flattens invite event + stripped state into an invite_state array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec proposal A matrix spec change proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants