You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this when trying the new room permalink support in Element X iOS.
When requesting the room summary for a room that isn't in the room directory, the SDK tries the MSC3266 room summary endpoint next.
For example, when opening the URL https://matrix.to/#/#matrix:matrix.org, the following request reaches my server:
GET /_matrix/client/unstable/im.nheko.summary/rooms/!OGEhHVWSdvArJzumhm:matrix.org/summary
Notice the absence of via URL parameters. This results in an error on the client and synapse complaining in the logs:
SynapseError: 400 - Missing via to query remote room
and returning:
{"errcode":"M_UNKNOWN","error":"Missing via to query remote room"}
The SDK then falls back to /state and /joined_members which fail because my server doesn't know the room.
This results in unavailable room previews for rooms that my server doesn't know about, aka remote rooms. For a single-user homeserver, this affects virtually all rooms since, if I'm not already in the room, my server likely doesn't know about it.
matrix.to uses the same API, however when telling it to use my server the summary call works and I can view room details. The API request differs in two interesting ways:
GET /_matrix/client/unstable/im.nheko.summary/rooms/%23matrix%3Amatrix.org/summary?via=matrix.org&_cacheBuster=1365069511896160
The summary API is called with the room alias from the permalink instead of the room id, and
via parameters are added, in this case from the server name in the alias.
Either of which is apparently enough to get the expected result from the API (based on manual testing).
A similar problem happens for permalinks already containing via parameters, where the parameters are not passed on. For example, https://matrix.to/#/!OGEhHVWSdvArJzumhm:matrix.org?via=matrix.org&via=wolfo.tech&via=blob.cat results in the same API request and the same synapse error.
The relevant code was introduced in #3339, which only passes the room id to ruma:
Thanks for the report! Indeed, the via parameters are not forwarded at the moment, not even sure the FFI layer includes the parameter, so I'll add that.
I noticed this when trying the new room permalink support in Element X iOS.
When requesting the room summary for a room that isn't in the room directory, the SDK tries the MSC3266 room summary endpoint next.
For example, when opening the URL
https://matrix.to/#/#matrix:matrix.org
, the following request reaches my server:Notice the absence of
via
URL parameters. This results in an error on the client and synapse complaining in the logs:and returning:
The SDK then falls back to
/state
and/joined_members
which fail because my server doesn't know the room.This results in unavailable room previews for rooms that my server doesn't know about, aka remote rooms. For a single-user homeserver, this affects virtually all rooms since, if I'm not already in the room, my server likely doesn't know about it.
matrix.to uses the same API, however when telling it to use my server the summary call works and I can view room details. The API request differs in two interesting ways:
via
parameters are added, in this case from the server name in the alias.Either of which is apparently enough to get the expected result from the API (based on manual testing).
A similar problem happens for permalinks already containing
via
parameters, where the parameters are not passed on. For example,https://matrix.to/#/!OGEhHVWSdvArJzumhm:matrix.org?via=matrix.org&via=wolfo.tech&via=blob.cat
results in the same API request and the same synapse error.The relevant code was introduced in #3339, which only passes the room id to ruma:
matrix-rust-sdk/crates/matrix-sdk/src/room_preview.rs
Lines 135 to 139 in 74b79d8
The text was updated successfully, but these errors were encountered: