[Standards] Unread syncing
kevin.smith at isode.com
Fri Dec 2 14:46:45 UTC 2016
> On 2 Dec 2016, at 14:35, Christian Schudt <christian.schudt at gmx.de> wrote:
>> Except that they’re not chat messages, so won’t be stored, and if they were you’d be potentially up to doubling the size of your archive (I guess adding a quarter to, on average) as you fill it with read markers - unless you want to customise the MAM service to understand unread state, in which case what have you gained?
> As I read this, I was suprised, that MAM would only store chat messages. But it turns out MAM allows to store "normal" and "additional non-conversation messages" as per § 5.1.1.
Indeed. But you seemed to be wanting to re-use MAM services without code-change, which isn’t likely to happen.
>> If you log on, your client does a complete synchronisation of all history from the (modified to include non-chat history for read markers) archive to local storage, and then processes the stanzas it will be able to see which contacts have unread messages and how many, yes. Having to do a full history download is clearly not tenable in the general case.
> Are we talking about "read by user", or "read by resource”?
“read by user"
> If it's "read by user", a client may receive zero unread messages and therefore not updating its local history, because the messages have already been read by another client (of the same user of course).
The “there are no unread messages” case is the simple one, yes.
> In that case, it's desirable to do a full history download anyway (not a full one, but only since the last download).
Why? I don’t think there’s a requirement that clients keep completely local copies of history (they may choose to do so, but they shouldn’t be required to, as there are plenty of other history-management strategies)
> If it would only download the unread messages, the client would miss the messages, which have already been read on another device, resulting in an incomplete local history presentation.
I think this is making a big assumption about how clients are going to deal with history (that they want to have a complete local copy).
To put this another way, quoting my earlier strawman:
<iq from=client to=account>
<iq from=account to=client>
<unread jid=romeo… id=oeub… count=3/>
<unread jid=juliet… id=acdb… count=1/>
how would one, using just 333 and 313 achieve the same thing? That is: after logging in, how does a client quickly discover which of their contacts have unread messages, and how many (and the id they need to query MAM for to get those messages, when they later want to show them)?
Assume that this is a reasonably high-volume account, that the client hasn’t been online for a while, and there are some contacts with unread messages that are buried hundreds of messages deep in the MAM archive since that JID was last mentioned, such that waiting for a complete download of all ‘missing’ data on the current network connection would take a (too large) number of minutes. Or just that it’s the first time this client has been used on this account, and there’s a lot of data in the archive.
More information about the Standards