-
Notifications
You must be signed in to change notification settings - Fork 418
MSC4384: Supporting alternative room directory sorting #4384
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
Open
turt2live
wants to merge
1
commit into
main
Choose a base branch
from
travis/room-dir-pinned
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # MSC4384: Supporting alternative room directory sorting | ||
|
|
||
| The "room directory" for a server is made up of two endpoints: [`GET /publicRooms`](https://spec.matrix.org/v1.16/client-server-api/#get_matrixclientv3publicrooms) | ||
| and [`POST /publicRooms`](https://spec.matrix.org/v1.16/client-server-api/#post_matrixclientv3publicrooms). | ||
|
|
||
| Both endpoints state that the directory is sorted by "largest rooms first", which creates some | ||
| challenges: | ||
|
|
||
| 1. Typically, a new user to a server will join the first 1-3 top rooms in the directory. On a server | ||
| like matrix.org, this may mean the room(s) they're joining are not as relevant or applicable to | ||
| new users. | ||
| 2. Because of the above, larger rooms can also end up with higher proportions of spam because accounts | ||
| will usually go top to bottom on the room list. | ||
| 3. For servers which are centered around a community, "largest" may not represent that community's | ||
| interests or needs best. A general chat may have low member counts, for example, but still be | ||
| important enough to have at the top of the list. | ||
| 4. In some cases, rooms are encouraged to fill themselves with bots or fake accounts to get higher | ||
| standing in the room directory. This can be used to create harm that is hard to detect without | ||
| a [moderated directory](https://matrix.org/homeserver/room-directory/). | ||
|
|
||
| This proposal removes the "largest first" requirement from both endpoints, allowing for implementation | ||
| specific sorting to happen. Though not specified in this proposal, implementations might be interested | ||
| in supporting a "pinned rooms" configuration option to ensure specific rooms remain at the top of the | ||
| room directory before sorting the remainder as "largest first" - this ensures that server-centered | ||
| communities can pin relevant rooms at the top and still have increased visibility on their remaining | ||
| rooms, though doesn't necessarily solve spam or abuse mitigations to the same degree. | ||
|
|
||
| ## Proposal | ||
|
|
||
| Both the [`GET /publicRooms`](https://spec.matrix.org/v1.16/client-server-api/#get_matrixclientv3publicrooms) | ||
| and [`POST /publicRooms`](https://spec.matrix.org/v1.16/client-server-api/#post_matrixclientv3publicrooms) | ||
| endpoints drop the "largest rooms first" requirement and instead say that sorting is an implementation | ||
| detail. The specification may wish to retain a recommendation to sort by largest first by default to | ||
| give server implementations some guidance on how to implement a basic room directory. | ||
|
|
||
| If servers choose a different sorting algorithm for the room directory, they will need to ensure that | ||
| the results are in a stable order for pagination to work. This may mean, for example, that "pinned" | ||
| rooms are put at the top of the total results list rather than each page of results delivered to the | ||
| client. | ||
|
|
||
| ## Potential issues | ||
|
|
||
| Mentioned in the proposal, servers may implement sorting algorithms which are unstably sorted, leading | ||
| to confusing pagination results. This would be considered a bug in the implementation rather than a | ||
| bug in the spec (or a feature in the implementation if it's desirable for whatever reason). | ||
|
|
||
| Though highly unlikely, there may be a client in the wild which requires the results to be ordered by | ||
| size. By nature of how the endpoints are usually implemented, it's expected that most (if not all) | ||
| clients will simply show the results verbatim, unaware of any particular ordering to the rooms. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| It's possible that an MSC is not necessarily required to make this change. The room directory endpoints | ||
| were created and documented an eternity ago, and don't use explicit "MUST" or "SHOULD" language as a | ||
| result. This MSC is created to document alignment on changing the ordering algorithm for historical | ||
| purposes. | ||
|
|
||
| ## Security considerations | ||
|
|
||
| Improving relevance in results can ensure that new users land in moderated rooms first instead of | ||
| large, potentially unmoderated, rooms. This improves the overall safety experience for users on the | ||
| public federation. | ||
|
|
||
| ## Unstable prefix | ||
|
|
||
| Not applicable. The risk of breaking clients is exceptionally low, and namespacing the endpoints to | ||
| support a change in language feels excessive. | ||
|
|
||
| However, while this proposal is considered unstable, servers are encouraged to only change the order | ||
| when the administrator has explicitly indicated that they want to do that. This may be done by an | ||
| "experimental feature flag" or other server-specific configuration, for example. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| This proposal has no direct dependencies. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements: