matrix-org / matrix-org/matrix-spec
CSAPI `GET /rooms/{roomId}/event/{eventId}` does not pull events over federation, breaking pinned messages (it's not clear how clients should fetch `m.room.pinned_events`)
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
**Link to problem area**:
- https://spec.matrix.org/v1.12/client-server-api/#mroompinned_events
- https://spec.matrix.org/v1.12/client-server-api/#get_matrixclientv3roomsroomideventeventid
**Issue**
Pinned events currently don't work in Element Web if the user is on a (Synapse) homeserver that doesn't have the event already in the local homeserver database.
The root cause appears to be because Element Web is fetching pinned events using the CSAPI `GET /rooms/{roomId}/event/{eventId}` endpoint, which does **not** pull events over federation. (The end result is that new users do not see the pinned events, assuming they aren't using a homeserver that was already in the room before. This degrades their utility as a replacement for the room topic.) Two problems here:
- The spec doesn't prescribe any behaviour for clients to fetch the events to display the pinned messages; I don't think you can blame Element Web from trying the obvious here.
- The spec doesn't mention whether `GET /rooms/{roomId}/event/{eventId}` should or should not pull over federation.
Even if this endpoint should pull over federation, it's not clear who to pull ***from***, given we have no hint as to which server has that event or not.
Contributor guide
Research direction
Start with the linked Matrix Client-Server API sections for m.room.pinned_events and GET /rooms/{roomId}/event/{eventId}, then review the reported federation behavior. Done means the specification clearly explains how clients should fetch pinned events and whether this endpoint federates, including how the source server is determined.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100