matrix-org / matrix-org/matrix-spec
Clarify `limit` parameter on `/context`
Nobody has claimed this yet.
- 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.15/client-server-api/#get_matrixclientv3roomsroomidcontexteventid
**Issue**
> limit integer
> The maximum number of context events to return. The limit applies to the sum of the events_before and events_after arrays. The requested event ID is always returned in event even if limit is 0. Defaults to 10.
The limit is specified as divided between `events_before` and `events_after`, which for odd limits implies a remainder. Rust-SDK tests that this remainder is given to `events_after`, despite a naive implementation discarding it with two truncated integer divisions. It probably derived this idea from some other implementation, establishing a de facto specification which should be reflected here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Matrix Client-Server API section for GET /rooms/{roomId}/context/{eventId}, then compare its limit wording with the Rust-SDK behavior described in the issue. Clarify how an odd limit is divided between events_before and events_after, including where the remainder goes; done means the specification removes this ambiguity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100