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 27 commits into
base: old_master
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
642f4e1
Room summary proposal
deepbluev7 Jul 4, 2021
188b6e5
Remove alias resolution step from the federation API
deepbluev7 Jul 5, 2021
dc5b372
Reference #688 in the alternatives section
deepbluev7 Jul 12, 2021
975ece5
Remove `is_direct` from response
deepbluev7 Jul 14, 2021
d148acf
Fix unstable prefixes for implementations which keep the prefix and r…
deepbluev7 Jul 14, 2021
6776863
Add allowed_room_ids field
deepbluev7 Jul 14, 2021
df376a3
Extend rationale for additional fields to reference MSC2946
deepbluev7 Jul 14, 2021
43eecf0
Add bulk API as an alternative
deepbluev7 Jul 14, 2021
66fee23
Remove federation API and address feedback
deepbluev7 Oct 6, 2021
469b77b
fix prefixes again
deepbluev7 Oct 20, 2021
04f807b
Remove extensions to federation API since that MSC is amended now
deepbluev7 Oct 20, 2021
f1233c4
Fix minor inaccuracy about the spaces sumary api
deepbluev7 Dec 3, 2021
5fc2f5b
Add encryption field back
deepbluev7 May 2, 2022
9e41b45
Add room version field
deepbluev7 May 2, 2022
cab37e5
Apply suggestions from code review
deepbluev7 May 2, 2022
a93190f
Add a bit more reasoning
deepbluev7 May 2, 2022
8186b72
version -> room_version
deepbluev7 May 4, 2022
1a8ecff
Apply suggestions from code review
deepbluev7 Jul 19, 2022
82d8f3b
Try to address review comments
deepbluev7 Jul 19, 2022
208a58c
Fix incorrect statement about encryption being a bool
deepbluev7 Jul 24, 2022
33f3733
Apply suggestions from code review
deepbluev7 Jul 26, 2022
a5bc9ef
Split up the big alternatives section
deepbluev7 Jul 26, 2022
ac3d5da
Collapse the same descriptions for publicRooms and hierarchy into one
deepbluev7 Jul 26, 2022
dba6705
Shorten the 'accessible' section again
deepbluev7 Jul 26, 2022
9719119
Update proposals/3266-room-summary.md
deepbluev7 Aug 1, 2022
2ad832c
Update proposals/3266-room-summary.md
deepbluev7 Dec 14, 2022
81fd904
Update proposals/3266-room-summary.md
deepbluev7 Dec 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions proposals/3266-room-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@ A response includes the stripped state in the following format:
world_readable: true,
join_rules: "public",
richvdh marked this conversation as resolved.
Show resolved Hide resolved
room_type: "m.space",
is_direct: true,
membership: "invite",
is_encrypted: true,
}
```

These are the same fields as those returned by `/publicRooms`, with a few
additions: `room_type`, `is_direct`, `membership` and `is_encrypted`.
additions: `room_type`, `membership` and `is_encrypted`.
t3chguy marked this conversation as resolved.
Show resolved Hide resolved

All those fields are already accessible as the stripped state according to
deepbluev7 marked this conversation as resolved.
Show resolved Hide resolved
[MSC3173](https://github.com/matrix-org/matrix-doc/pull/3173), with the
deepbluev7 marked this conversation as resolved.
Show resolved Hide resolved
exception of `membership` and potentially `is_direct`.
exception of `membership`.
t3chguy marked this conversation as resolved.
Show resolved Hide resolved

#### Rationale and description of reponse fields
deepbluev7 marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -87,21 +86,19 @@ exception of `membership` and potentially `is_direct`.
| world_readable | If the room history can be read without joining. | Copied from `publicRooms`. |
| join_rules | Join rules of the room | Copied from `publicRooms`. |
| room_type | Optional. Type of the room, if any, i.e. `m.space` | Used to distinguish rooms from spaces. |
| is_direct | Optional. If this is a direct chat. The server should use the usual rules to figure out, if this is a direct chat, not just look in the create event. | May be used in previews to distinguish normal rooms from DMs. |
| membership | The current membership of this user in the room. Usually `leave` if the room is fetched over federation. | Useful to distinguish invites and knocks from joined rooms. |
richvdh marked this conversation as resolved.
Show resolved Hide resolved
| is_encrypted | Optional. If the room is encrypted. This is already accessible as stripped state. Currently a bool, but maybe the algorithm makes more sense? | Some users may only want to join encrypted rooms or clients may want to filter out encrypted rooms, if they don't support encryption. |
deepbluev7 marked this conversation as resolved.
Show resolved Hide resolved

It should be possible to call this API without authentication, but servers may
rate limit how often they fetch information over federation more heavily, if the
user is unauthenticated. Also the fields `membership` and `is_direct` will be
user is unauthenticated. Also the fields `membership` will be
missing.

### Server-Server API

The Server-Server API mirrors the Client-Server API, with a few exceptions. The
`membership` and `is_direct` fields are never present. No `via` field is
necessary on the request, since servers should not forward the request to other
servers.
`membership` fields is never present. No `via` field is necessary on the
request, since servers should not forward the request to other servers.

The server can't know, which user is requesting the summary. As such it should
apply visibility rules to check if any user on the requesting server would have
Expand Down Expand Up @@ -171,10 +168,10 @@ ratelimiting and caching should be able to mitigate that.

## Unstable prefix
Copy link
Member

Choose a reason for hiding this comment

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

This should also define a new unstable_features flag for GET /_matrix/client/versions.

For example, adapting from MSC3026:

servers implementing this MSC must expose a flag in GET /_matrix/client/versions responses, under unstable_features, named im.nheko.msc3266, which is set to true.

Other MSCs that define an unstable_features are MSC2432, MSC2666, MSC2285, MSC3827, and MSC3440.


This uses the `im.nheko.summary` unstable prefix instead of the `summary` key in
the request paths during the MSC phase. As a result:
This uses the `im.nheko.summary` unstable prefix. As such the paths are prefixed
with `unstable/im.nheko.summary`.

- the client API will be
`/_matrix/client/unstable/rooms/{roomidOrAlias}/im.nheko.summary`
`/_matrix/client/unstable/im.nheko.summary/rooms/{roomidOrAlias}/summary`
- the federation API will be
`/_matrix/federation/unstable/im.nheko.summary/{roomid}`
`/_matrix/federation/unstable/im.nheko.summary/summary/{roomid}`