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

MSC3266: Room summary API #3266

Open
wants to merge 43 commits into
base: old_master
Choose a base branch
from

Conversation

deepbluev7
Copy link
Contributor

@deepbluev7 deepbluev7 commented Jul 4, 2021

Rendered.

Somewhat related to MSC2946 this provides an API to get a summary for a specific room either from the local server or over federation.

Useful for a few cases, where you need to show a summary for a room like matrix.to, traveler bots, showing spaces, lightweight clients, etc.

Open design questions looking for feedback: see this comment chain: #3266 (comment) resolved as of 2021/10/06

Implementations:

Signed-off-by: Nicolas Werner nicolas.werner@hotmail.de


SCT stuff:

Shepherd: @richvdh
FCP tickyboxes

Checklist: #3266 (comment)

Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
@deepbluev7 deepbluev7 changed the title Room summary proposal MSC3266: Room summary proposal Jul 4, 2021
@deepbluev7 deepbluev7 changed the title MSC3266: Room summary proposal MSC3266: Room summary Jul 4, 2021
@turt2live turt2live added client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal proposal-in-review labels Jul 5, 2021
@deepbluev7 deepbluev7 changed the title MSC3266: Room summary MSC3266: Room summary API Jul 11, 2021
Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
…est of the path separate

Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
That way the requesting server knows, if any user would have access to
that room and it can forward the room to the user.

Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
These are the same fields as those returned by [`/publicRooms`](https://spec.matrix.org/v1.13/client-server-api/#get_matrixclientv3publicrooms) or
[`/hierarchy`](https://spec.matrix.org/v1.13/client-server-api/#get_matrixclientv1roomsroomidhierarchy)
, with a few additions: `membership`, `room_version`,
`encryption` and `allowed_room_ids`.
Copy link
Member

Choose a reason for hiding this comment

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

allowed_room_ids isn't mentioned in the format.

Copy link
Member

Choose a reason for hiding this comment

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

sorry, which format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean in the example above? Yes, because the join_rule is public. It is explained in the table below though, which also says that the field is optional. Does this need an example specifically with the room_ids, if the /hierarchy API already uses that field?

Copy link
Member

Choose a reason for hiding this comment

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

In the JSON object above, yep, but the text says, "in the following format" rather than, "for example" so I was reading that as a canonical definition rather than an example. This might just be a case of misunderstanding and it just needs to be relabelled as an example.

Copy link
Member

Choose a reason for hiding this comment

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

Clarified in 45fbfab.

Comment on lines 43 to 45
Note that rooms the user has been invited to or knocked at might result in
outdated or partial information, since the the homeserver may not have access
to the current state of the room.
Copy link
Member

Choose a reason for hiding this comment

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

Why? Wouldn't the server just go & get the latest data the same as it would if they weren't invited?

Copy link
Member

Choose a reason for hiding this comment

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

Great question. @deepbluev7: can you shed any light here?

Looking at the synapse implementation, the logic goes:

  • If the server has at least one user whose membership is join, generate the summary locally
  • Otherwise, call out to GET /_matrix/federation/v1/hierarchy/{roomId} (or the local cache).

I don't see any reason that rooms the user has been invited to or knocked at would be special here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no way to fetch a room summary over federation, that isn't publicly joinable and a user has been invited to. How would it fetch a more up to date state? That is not how invites currently work on Matrix.

Copy link
Member

Choose a reason for hiding this comment

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

Mmhmm. So, in the current implementation: if you you have been invited to a remote room that isn't publicly joinable, /summary will return an 404 M_NOT_FOUND for that room, right?

Which I guess is kinda "outdated or partial information".

Copy link
Member

Choose a reason for hiding this comment

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

Oh, because it's using the /hierarchy API over federation which doesn't allow fetching state of rooms you're not joined to? I hate to say it knowing you've already switched away from adding a federation part to the API, but possibly this would be a good reason to have one, then it could allow servers to view the summary if they had a user that had been invited. Potentially it could be left to a separate MSC but I'd certainly like if it were explained a lot better in the meantime.

Copy link
Member

Choose a reason for hiding this comment

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

Clarified in 7299a8b

Comment on lines +198 to +215
### The `sync` API

For joined rooms, the `/sync` API can be used to get a summary for all joined
rooms. Apart from not working for unjoined rooms, like knocks, invites and space
children, `/sync` is very heavy for the server and the client needs to cobble
together information from the `state`, `timeline` and
[`summary`](https://github.com/matrix-org/matrix-doc/issues/688) sections to
calculate the room name, topic and other fields provided in this MSC.

Furthermore, the membership counts in the summary field are only included, if
the client is using lazy loading. This MSC provides similar information as
calling `/sync`, but to allow it to work for unjoined rooms it only uses information
from the stripped state. Additionally, it excludes `m.heroes` as well as membership
events, since those are not included in the stripped state of a room. (A client
can call `/joined_members` to receive those if needed. It may still make sense
to include heroes so that clients could construct a human-friendly room display
name in case both the name and the canonical alias are absent; but solving the
security implications with that may better be left to a separate MSC.)
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 sure this is really an alternative, or at least not one that needs 2 paragraphs of discussion. It's not a problem that it's here, but just as feedback for the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is mentioned as an alternative, because people brought up "just call sync" when I initially discussed this MSC with people. This section is an argument in that discussion. It obviously isn't a good alternative, but people needed that spelled out at the time and I didn't want to have this argument multiple times.

@richvdh
Copy link
Member

richvdh commented Feb 25, 2025

@mscbot concern should unauthenticated access be enabled by default?

@mscbot mscbot added the unresolved-concerns This proposal has at least one outstanding concern label Feb 25, 2025
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@richvdh
Copy link
Member

richvdh commented Mar 4, 2025

I have given this another round of updates. SCT members who had previously ticked their boxes may wish to give this another round of review; however I hope there is nothing that will be controversial here. @deepbluev7 likewise: I hope you don't object to any of my changes here.

I think there are only two material changes:

  • Most notably: whether to expose the endpoint to unauthenticated access is now left as a decision for admins and server implementations (2f48c41, 872c5de).
  • I took the executive decision to add canonical_alias to the response: it looked like its omission was an accident rather than deliberate.

There have been a number of other changes, but I believe they are all clarifications, rather than material changes.

@richvdh
Copy link
Member

richvdh commented Mar 4, 2025

@mscbot resolve should unauthenticated access be enabled by default?

@mscbot mscbot removed the unresolved-concerns This proposal has at least one outstanding concern label Mar 4, 2025
@richvdh richvdh requested review from dbkr, t3chguy and erikjohnston and removed request for t3chguy March 4, 2025 16:02
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
@mscbot
Copy link
Collaborator

mscbot commented Mar 7, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

@mscbot mscbot added final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. and removed proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. labels Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API disposition-merge final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. kind:feature MSC for not-core and not-maintenance stuff proposal A matrix spec change proposal
Projects
Development

Successfully merging this pull request may close these issues.