-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(event cache): override
reached_start
when there's a mismatch be…
…tween network and disk It could be that we have a mismatch between network and disk, after running a back-pagination: - network indicates start of the timeline, aka there's no previous-batch token - but in the persisted storage, we do have an initial empty events chunk Because of this, we could have weird transitions from "I've reached the start of the room" to "I haven't actually reached it", if calling the `run_backwards()` method manually. This patch rewrites the logic when returning `reached_start`, so that it's more precise: - when reloading an events chunk from disk, rely on the previous chunk property to indicate whether we've reached the start of the timeline, thus avoiding unnecessary calls to back-paginations. - after resolving a gap via the network, override the result of `reached_start` with a boolean that indicates 1. there are no more gaps and 2. there's no previous chunk (actual previous or lazily-loaded). In the future, we should consider NOT having empty events chunks, if we can.
- Loading branch information
Showing
4 changed files
with
60 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters