libQuotient icon indicating copy to clipboard operation
libQuotient copied to clipboard

Limited sync response leaves gaps in the timeline

Open KitsuneRal opened this issue 6 years ago • 2 comments

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:

  1. 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.
  2. Set a huge limit for the non-initial sync and hope it's not bumped into.
  3. 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.

KitsuneRal avatar Aug 17 '18 04:08 KitsuneRal

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.

ara4n avatar Aug 17 '18 12:08 ara4n

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 :)

KitsuneRal avatar Aug 18 '18 03:08 KitsuneRal