|
| 1 | +# MSCXXXX: Migrate `server_name` to `via` |
| 2 | + |
| 3 | +Room IDs in Matrix are generally not routable on their own. In the [room ID grammar] `!opaque_id:domain`, |
| 4 | +the `domain` is the server that created the room. There is, however, no guarantee that this server is |
| 5 | +still joined to the room at a later time. Therefore, room IDs don't provide a reliable resident server |
| 6 | +to send requests to. |
| 7 | + |
| 8 | +The spec partially addresses this issue by defining a [`via`] query parameter on room URIs that can be |
| 9 | +used to list servers that have a high probability of being in the room in the distant future. Additionally, |
| 10 | +some APIs such as [`/_matrix/client/v3/join/{roomIdOrAlias}`] can take a `server_name` query parameter |
| 11 | +that has the same effect as `via`. |
| 12 | + |
| 13 | +The terminology difference between `server_name` and `via` can be slightly confusing which is why this |
| 14 | +proposal attempts to standardize on `via`. |
| 15 | + |
| 16 | + |
| 17 | +## Proposal |
| 18 | + |
| 19 | +The `server_name` query parameter on [`/_matrix/client/v3/join/{roomIdOrAlias}`] and |
| 20 | +[`/_matrix/client/v3/knock/{roomIdOrAlias}`] is deprecated and a new parameter `via: [string]` is |
| 21 | +introduced. Clients MUST use `via` when the homeserver they're talking to supports it. To do this, they |
| 22 | +MAY either detect server support through [`/_matrix/client/versions`] or always include both parameters. |
| 23 | +Homeservers MUST prefer `via` if both parameters are supplied. |
| 24 | + |
| 25 | + |
| 26 | +## Potential issues |
| 27 | + |
| 28 | +As with any migration, some effort will be required to update client and server implementations. Additionally, |
| 29 | +while the transitions isn't completed, the concurrent existence of both query parameters might lead to further |
| 30 | +confusion. |
| 31 | + |
| 32 | + |
| 33 | +## Alternatives |
| 34 | + |
| 35 | +None other than accepting status quo. |
| 36 | + |
| 37 | + |
| 38 | +## Security considerations |
| 39 | + |
| 40 | +None. |
| 41 | + |
| 42 | + |
| 43 | +## Unstable prefix |
| 44 | + |
| 45 | +Until this proposal is accepted into the spec, implementations SHOULD refer to `via` as `org.matrix.mscXXXX.via`. |
| 46 | + |
| 47 | + |
| 48 | +## Dependencies |
| 49 | + |
| 50 | +None. |
| 51 | + |
| 52 | + |
| 53 | +[room ID grammar]: https://spec.matrix.org/v1.10/appendices/#room-ids |
| 54 | +[`via`]: https://spec.matrix.org/v1.10/appendices/#routing |
| 55 | +[`/_matrix/client/v3/join/{roomIdOrAlias}`]: https://spec.matrix.org/v1.10/client-server-api/#post_matrixclientv3joinroomidoralias |
| 56 | +[`/_matrix/client/v3/knock/{roomIdOrAlias}`]: https://spec.matrix.org/v1.10/client-server-api/#post_matrixclientv3knockroomidoralias |
| 57 | +[`/_matrix/client/versions`]: https://spec.matrix.org/v1.10/client-server-api/#get_matrixclientversions |
0 commit comments