Calling PUT /_matrix/federation/v1/invite/{roomId}/{eventId}
on a remote homeserver is redundant if they're already in the room
#2062
Labels
improvement
An idea/future MSC for the spec
PUT /_matrix/federation/v1/invite/{roomId}/{eventId}
is useful, and its own endpoint, as homeservers that aren't yet participating in a room need to be directly notified when one of their users has been invited.However, if a homeserver is already participating in a room, when one of their user is invited they'll receive both:
m.room.member
invite
event over thePUT /_matrix/federation/v1/send/{txnId}
endpoint.PUT /_matrix/federation/v1/invite/{roomId}/{eventId}
.Both of these tell the homeserver the same thing - and in practice developers tend to only implement event handling based on one of these. Typically
/invite
.This also created subtle implementation bugs such as element-hq/synapse#18075 in Synapse - where Synapse notifies clients that they've been invited based on
/invite
- but doesn't actually consider the user invited until the correspondingm.room.member
event comes in. If the user tries to join the room in this gap - they'll get an error that they haven't been invited.It's also just unnecessary work - we don't need to notify a remote homeserver about an invite twice.
(credit to @MadLittleMods for originally pointing this out in the Synapse PR linked about.)
The text was updated successfully, but these errors were encountered: