JFYI, We have developed and implemented a sync protocol that does this almost instantly and load all chats in reverse chronological order. Here is a video <https://www.dropbox.com/s/ify29keje4xomc6/RPReplay_Final1628510714.MP4?dl=0> of how it looks immediately after login, recorded just now, in real time with no editing.
For every conversation, it syncs the most recent message, amount of unread messages, delivered / displayed markers. In the future, it'll also sync mute / archived / pinned / special notification states. пн, 9 авг. 2021 г. в 16:51, Sam Whited <[email protected]>: > Hi all, > > I started a PR against modernxmpp to document MAM sync strategies after > a discussion on jdev yesterday: > > https://github.com/modernxmpp/modernxmpp/pull/41 > > I wondered if anyone would share what their sync strategy is (or even > possibly add it to that PR) so that we can document a few clients and > maybe move towards an XEP that outlines one or two ideal ones? > > I'll start with the one I described in the chat yesterday that's used > (experimentally) by Mellium/Communiqué: > > On client start iterate through all items in the roster. If no messages > exist in the local archive: Query in reverse order (in case the server > breaks it up by page and we end up committing pages separately) with > before: now && limit: X (where X is some configurable number, what we > think will fit on the page with some margin, etc.). Otherwise query with > after-id: <last message> (making sure that the last message was pulled > from the DB before we send initial presence). > > If the user scrolls to the top of the history, query in reverse order > with before-id: <first message>. Fetch the next page for as long as they > continue to scroll up. > > Thanks, > Sam > > -- > Sam Whited > _______________________________________________ > Standards mailing list > Info: https://mail.jabber.org/mailman/listinfo/standards > Unsubscribe: [email protected] > _______________________________________________ > -- Andrew Nenakhov CEO, redsolution, OÜ https://redsolution.com <http://www.redsolution.com>
_______________________________________________ Standards mailing list Info: https://mail.jabber.org/mailman/listinfo/standards Unsubscribe: [email protected] _______________________________________________
