Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note to the federation invite endpoints that invites can be sent twice #2067

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Jan 28, 2025

As this may be non-obvious when implementing behaviour that is triggered by an incoming invite event.

See #2062 for more context. Closes #2062.

Preview: https://pr2067--matrix-spec-previews.netlify.app

…t twice

As this may be non-obvious when implementing behaviour that is triggered by an incoming invite
event.

See #2062 for more context.
Copy link
Contributor

@zecakeh zecakeh left a comment

Choose a reason for hiding this comment

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

Regarding the discussion in #2062, I actually saw this endpoint only as a request from the inviting homeserver to the invited homeserver to sign the event, not that it should have other side effects. But it's true that the description is vague and doesn't actually say what should happen on the invitee's side.

As a side note, it is also not clear in which order the signatures are applied here. Should the event already have the signature from the inviting homeserver? It would make sense that the invited homeserver checks the signature before signing it itself. The text doesn't say anything about it, and the definitions don't include a signatures field in the request (or the response for that matter), but the data has an example of a request with the signatures field (which appears in #2076).


Also note that if the remote homeserver is already in the room, it will receive the
invite event twice; once through this endpoint, and again through a [federation
transaction](https://spec.matrix.org/v1.13/server-server-api/#transactions).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
transaction](https://spec.matrix.org/v1.13/server-server-api/#transactions).
transaction](/server-server-api/#transactions).

Otherwise it will always point to that spec version


Also note that if the remote homeserver is already in the room, it will receive the
invite event twice; once through this endpoint, and again through a [federation
transaction](https://spec.matrix.org/v1.13/server-server-api/#transactions).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
transaction](https://spec.matrix.org/v1.13/server-server-api/#transactions).
transaction](/server-server-api/#transactions).

@richvdh
Copy link
Member

richvdh commented Feb 25, 2025

Should the event already have the signature from the inviting homeserver?

Synapse's implementation of PUT /_matrix/federation/v2/invite/{roomId}/{eventId} seems to require a valid signature on the incoming event, so I think the answer to this is "yes". That doesn't seem to be specced though, and it could do with being.

@richvdh
Copy link
Member

richvdh commented Feb 25, 2025

I actually saw this endpoint only as a request from the inviting homeserver to the invited homeserver to sign the event, not that it should have other side effects.

It has to have a side-effect, at least in the case where the invited homeserver is not already in the room: the server must tell the user they have been invited and allow them to join the room if they wish.

@zecakeh
Copy link
Contributor

zecakeh commented Feb 26, 2025

I actually saw this endpoint only as a request from the inviting homeserver to the invited homeserver to sign the event, not that it should have other side effects.

It has to have a side-effect, at least in the case where the invited homeserver is not already in the room: the server must tell the user they have been invited and allow them to join the room if they wish.

Ah right, sorry for the noise then.

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.

Document that incoming invite events will reach a homeserver twice - once over /invite and again over /send
3 participants