libQuotient
libQuotient copied to clipboard
Limited sync response leaves gaps in the timeline
As Matthew mentioned in #matrix-dev, there's a case when /sync
returns limited: true
, meaning it held off some events. Unless it's an initial sync (where limited
is almost always true
), the library never fetches these held events, leaving irrecoverable gaps in the timeline. With the current limit of 100 event per sync it's pretty hard to get to it in the first place; but massive netsplits or similar occurences (see, e.g., events below this) may easily poke a hole (however (ir)relevant is besides the point).
It's not quite clear how to remedy this, though. Below are some ideas:
- Run a follow-up
/messages
request within processing the current sync response so that events are only accommodated into the timeline after the entire bulk of events is received. - Set a huge limit for the non-initial sync and hope it's not bumped into.
- Change
Room
API so that timeline can receive messages in the middle, not only on the ends (can even make it in a back-compatible way so that clients can upgrade to the new API eventually).
Other ideas are welcome.
or just throw away the history for a room when you get a limited sync, and then use normal backpagination via /messages if the user wants to fill in the gaps. this is what Riot does on Mobile. Riot Web tries to fill in the gaps, which is probably more hassle than it's worth.
Thanks, right, thinking more about it it feels a good alternative - even though this affects my clients too because so far there's been no such thing as "throw away the history" in libQMatrixClient :)