matrix-org / matrix-org/matrix-spec
Asymmetry of GET /rooms/:room_id/state vs. .../state/:type/:key (SPEC-264)
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
If you `GET` the entire room state, what you get back is a JSON list, containing individual events. Within those events, are content keys.
If you `GET` a single state message, what comes back is just the value of `content`, not the entire event.
When we get around to designing client API v2 for this, we should redesign it for more symmetry. The specific use-case I have in mind is wanting to find the `event_id` of my own `m.room.member` event in a room. I can't just `GET` that one event because I'll only get the content; instead I have to `GET` the entire room state and iterate over it to find the appropriate event.
(Imported from https://matrix.org/jira/browse/SPEC-264)
(Reported by @leonerd)
Contributor guide
Research direction
Start by comparing the documented GET /rooms/:room_id/state and GET /rooms/:room_id/state/:type/:key endpoints described in the issue. Define a v2 response design that makes whole-state and single-state retrieval symmetric and supports finding the event_id for an m.room.member event; the issue does not identify files or tests.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100