timeline: after an event cache update lag, fetch previous events back from the cache #3345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3311.
When the timeline is lagging behind the event cache, it should not only clear what it contains (because it may be lagging some information coming from the event cache), it should also retrieve the events the cache knows about, and adds them as if they were "initial" events.
This makes sure that the event cache's events and the timeline's events are always the same, and that, in the case of a lag, there won't be any missing chunks (caused by the event cache back-pagination being further away in the past, than what's displayed in the timeline).
The lag behind a bit too hard to reproduce, I've not included a test here; but I think this should be the right move.