From 56efd7eee00a26aec0a2b35b3954c679ff65ce91 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 17 Aug 2020 15:22:25 +0200 Subject: [PATCH] don't load timeline past gaps --- src/matrix/room/timeline/persistence/TimelineReader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/room/timeline/persistence/TimelineReader.js b/src/matrix/room/timeline/persistence/TimelineReader.js index ea40f8a4..928d6b64 100644 --- a/src/matrix/room/timeline/persistence/TimelineReader.js +++ b/src/matrix/room/timeline/persistence/TimelineReader.js @@ -60,8 +60,8 @@ export class TimelineReader { let fragmentEntry = new FragmentBoundaryEntry(fragment, direction.isBackward, this._fragmentIdComparer); // append or prepend fragmentEntry, reuse func from GapWriter? directionalAppend(entries, fragmentEntry, direction); - // don't count it in amount perhaps? or do? - if (fragmentEntry.hasLinkedFragment) { + // only continue loading if the fragment boundary can't be backfilled + if (!fragmentEntry.token && fragmentEntry.hasLinkedFragment) { const nextFragment = await fragmentStore.get(this._roomId, fragmentEntry.linkedFragmentId); this._fragmentIdComparer.add(nextFragment); const nextFragmentEntry = new FragmentBoundaryEntry(nextFragment, direction.isForward, this._fragmentIdComparer);