Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination: specify returned tokens when the end of pagination is hit. (SPEC-319) #610

Closed
matrixbot opened this issue Jan 6, 2016 · 2 comments
Assignees
Labels
spec-omission implemented but not currently specified

Comments

@matrixbot
Copy link
Member

This information is missing in the specification of "rooms/roomId/messages" API.

Presently when we hit the end of pagination the chunk is empty and both tokens start/end are equal (see attachment EndOfPagination.png).

(Imported from https://matrix.org/jira/browse/SPEC-319)

(Reported by @giomfo)

Attachments:

https://matrix.org/jira/secure/attachment/10226/EndOfPagination.png

@matrixbot
Copy link
Member Author

Jira watchers: @giomfo

@matrixbot
Copy link
Member Author

Note: chunk.count =0 is not enough to decide end of pagination. The client must check start token = end token in server response.

Indeed the client may receive empty chunk during back pagination on a period where the user was outside the room.

Example: I joined a room, I left it, others sent more than 20 messages while I am outside, then I joined again.
I receive empty chunk when I scroll back in room history. The start/end tokens are different in this case.

-- @giomfo

@matrixbot matrixbot changed the title Pagination: specify returned tokens when the end of pagination is hit. Pagination: specify returned tokens when the end of pagination is hit. (SPEC-319) Oct 31, 2016
@matrixbot matrixbot added the spec-bug Something which is in the spec, but is wrong label Nov 7, 2016
@richvdh richvdh added spec-omission implemented but not currently specified and removed spec-omission implemented but not currently specified spec-bug Something which is in the spec, but is wrong labels Oct 11, 2017
@turt2live turt2live added this to To do: client-server (prioritized) in August 2018 r0 Aug 14, 2018
@turt2live turt2live self-assigned this Aug 31, 2018
turt2live added a commit to turt2live/matrix-doc that referenced this issue Aug 31, 2018
Previously the section was very strict in what pagination was, however this isn't the reality for the matrix specification. Several endpoints have their own pagination naming conventions and do not follow those mandated by this section.

This commit generalizes the language to cover those endpoints while also describing how pagination works. In particular, it describes the rough API shape to expect and how to deal with the responses.

This commit also removes the `M_BAD_PAGINATION` error as it is not used in the real world. Homeservers are instead encouraged to use the standard `M_INVALID_PARAM` or similar error code.

Fixes matrix-org#610
Fixes matrix-org#1523
@turt2live turt2live moved this from To do: client-server (prioritized) to In review (just the issues) in August 2018 r0 Aug 31, 2018
August 2018 r0 automation moved this from In review (just the issues) to Done (this list will be incomplete) Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec-omission implemented but not currently specified
Projects
No open projects
August 2018 r0
  
Done (this list will be incomplete)
Development

No branches or pull requests

3 participants