Skip to content

Clarify limit parameter on /context #2202

@jevolk

Description

@jevolk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationAn area where the expected behaviour is understood, but the spec could do with being more explicit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions