-
Notifications
You must be signed in to change notification settings - Fork 14
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
Paginated atom feed #147
Comments
Hm, couldn't that already be done with the |
No. #116 added links for individual updates. This will add links for the complete feed. Because I think we all agree to support this I will take care of this issue. |
One thing that might have to be considered is how to handle new feed entries while a client is browsing through the paginated feed. Example:
Another example:
|
I had this discussion previously. Is there any other solution than passing the first (or last item) processed in the current chunk? With this information the server could solve some of your problematic use cases. |
I'm not sure I understand what you mean by that. Do you mean adding more information to the 'previous' link so that the server can figure out "from where to start"?
|
@pschirmacher That's a A quick search through the HTTP Status Codes let's me assume that this would be an |
@pschirmacher: Yes that was the idea I had. In general the problem described here is hard to solve without taking a snapshot of the data for a complete session from a client. And this is something nobody want's to do (at least in this case). |
@tloist It's not! That would only happen if the server held the state of the list/ cursor, the client is currently iterating over. I seriously hope that none of us would implement it this way.
@pschirmacher That makes perfect sense to me. Optionally we should add the number/ count of items to fetch. In this case the server could simply get the list of all the "updates", find the item with |
Only problem with this approach is calculating the last link because the from parameter points to the newest item in the current chunk. |
Hm the RFC states:
So at least the simplest possible solution would satisfy the RFC... |
@aheusingfeld That's the same scenario - that's what I meant. And my suggestion involved that the client remembers the state of the resource it previously accessed. Actually @mvitz introduced the idea of a snapshot. But in this case I don't get the problem because the list of feeds is an append only list. So if you reference them relative from the beginning the same index always points to the same element. @mvitz The RFC assumes that the resource has arbitrary modifications (e.g. deletion of a feed) which is not (is it?) the case here. |
Not a problem if the "rel=next" points to a url containing |
@tloist You can delete your own updates as long as there is no reply to it and the RFC assumes that entries are created and deleted while some client is browsing the paginated atom feed. This can happen with statuses. @aheusingfeld |
Okay, say, I want to get all the hot new entries beginning from where I left of (e.g. I know the last entry I read had ID: The discussion here tells me that I can't use the paginated feed (which is the default), right? |
I think it should be permissible here.
I don't think that fits here. The client might send an ETag to indicate what status of the resource it's expecting, and if the status of the resource changed, the server might respond with |
Maybe deleting entries from the feed can be avoided? E.g. by doing a soft delete in the database and just removing the content from the feed entry? |
Hm. In my mind every deleted entry (even if done with soft deletion) should not appear in the feed. |
Ok, let's get the semantics clear first of all. The hard part is that "rel=prev" and "rel=next" have the semantics of e.g. the browser back button and not of time. Which is because we "travel back in time" when paging through the entries. But my point is that when the server generates the page, he always knows the ids of the 20 entries he returns and the next older entry and then next younger entry! Therefore the client doesn't need to guess! For the following I assume that the default count of entries in a list is 20: rel=first -> get youngest entryReturns a list of entries starting with the latest, freshest dp-entry and the 20 entries which happened before that latest entry rel=next -> get older entriesReturns a list of entries starting with the db-entry which comes directly after the oldest entry in the current list and the 19(1) entries which happened before that entry. rel=prev -> get younger entriesReturns a list of entries ending with the db-entry which comes directly before the youngest entry in the current list and the 19(!) entries which happened after that entry. rel=last -> get oldest entryReturns a list of entries starting with the db-entry which comes directly after the entry with id=1 in the current list and the 19 entries which happened before that entry. Does that make sense? With this solution we have a very simple |
👍 |
@mvitz It doesn't matter which id it is or whether that id exists - it just needs to be the smallest id in the db as our db query is |
@aheusingfeld OK! >= 0 in case of statuses ;-) |
This would be nice to have: http://tools.ietf.org/html/rfc5005#section-3. It would allow feed consumers to access old entries (e.g. after downtime or similar).
The text was updated successfully, but these errors were encountered: