-
Notifications
You must be signed in to change notification settings - Fork 382
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 section refers to non-existent prev_batch token when back-paginating #1898
Comments
The /messages spec could do with making it clear that |
I thought we had an issue for it, but apparently not: the pagination API is inconsistently used on top of this. It's applied to the letter on some endpoints, and not at all on others. We may have to think critically about whether or not we want it, and how we want to fix it. |
You might be thinking of #1523? |
Yup, that would explain why I can't find it too. I don't remember fixing it, but it sounds like I did. |
A list of endpoints which implement pagination:
Note that |
I'd like to try and come up with a convention for pagination parameters, which at least new APIs (such as the one being discussed in MSC2946, and sync v3) can follow. My thoughts so far:
Broadly I think I favour:
As a final thought: we could do something completely different like follow Github's pattern of using |
So if I understand correctly:
This makes These aren't problems per se, just observations based on the proposed naming. I care more about consensus more than anything else, so things like this seem reasonable. |
Yes, sounds like you understand correctly.
Surely any API that paginates returns batches? Unless the word "batch" means something special to you that it doesn't to me? Anyway, yes I agree it's a bit redundant, but since it's reasonably widely used currently I feel like I'd rather live with that than change everything. Similarly @ara4n proposed
@kegsay explained in chat that sync v3 does this to support two different types of token, where one token is used to paginate results, and the other is used to skip straight to the next point in the stream. If this is a requirement, I think it's fine to diverge from the convention for complicated APIs like |
FYI sync v3 now uses |
The Pagination section in the C-S API was, basically, full of rubbish. I think that anything of any value it contained was repeated either directly on the API definitions or in the text specific to syncing at https://spec.matrix.org/unstable/client-server-api/#syncing. The conventions I've added to the Appendices are based on the discussions in #1898. They are there because I don't want to have to go through it all again next time we add a paginated API. Fixes: #1898 Fixes: #2268
The Pagination section in the C-S API was, basically, full of rubbish. I think that anything of any value it contained was repeated either directly on the API definitions or in the text specific to syncing at https://spec.matrix.org/unstable/client-server-api/#syncing. The conventions I've added to the Appendices are based on the discussions in #1898. They are there because I don't want to have to go through it all again next time we add a paginated API. Fixes: #1898 Fixes: #2268
https://spec.matrix.org/unstable/client-server-api/#pagination says 'In this scenario, the
prev_batch
token would be excluded from the response', but /messages doesn't have aprev_batch
token. Presumably it meansend
.The text was updated successfully, but these errors were encountered: