-
Notifications
You must be signed in to change notification settings - Fork 265
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): don't fill initial items if the room already had ev…
…ents (#4381) The test requires subtle conditions to trigger: - initialize a timeline from a room-list-service's room - start a backpagination with that timeline (so the room event cache's paginator is busy) - try to initialize another timeline with the same room-list-service's room (e.g. because the first room has been closed, and the app using it doesn't have a room cache) This would fail, because initializing a timeline calls `EventCache::add_initial_events()` all the time, which tries to reset the paginator's state, which assumes the paginator's not paginating at this point. In a soon future, we'll get rid of the `add_initial_events()` function because the event cache will handle its own persistent storage; in the meantime, a correct fix is to skip `add_initial_events()` if there was already something in the linked chunk. After all, we're likely to fill the initial events with the same events all the time, or a subset of more recent events. By doing that, we're likely keeping *more* events in the linked chunk, instead. Thanks to @stefanceriu for reporting the issue and confirming the fix works!
- Loading branch information
Showing
2 changed files
with
92 additions
and
3 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