-
Notifications
You must be signed in to change notification settings - Fork 1
Description
One way for clients to efficiently use a reverse-chronological collection like the messages collection is to store a last-seen activity or object id.
To get the latest data, the client can get the latest page from the collection (first property), then follow the next properties of each page, until it finds a page with last-seen activity id in the items or orderedItems property. All the data that has been read is the "latest data". The client might show the latest items first, and then use scrolling to show earlier items.
The problem with this process in MLS is that the client state is very dependent on previous state. So, the client has to cache all the data in the latest pages until it finds the last-seen item, and then apply all the new activities in order, forwards in time, in order to calculate the current state. This takes time and memory.
One way to improve this process is to have a feature for jumping directly to the page with the last-seen activity, without reading all the later pages. Then, if the collection is bidirectionally navigable (it has next and prev links on each page), the client can navigate forward in time, up to the current page.