From 0d798178b0218a7dd8c4e3e7ad5a19cad77ad153 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 23 Sep 2021 18:50:40 +0200 Subject: [PATCH] log neighbor fragment id when closing gap --- src/matrix/room/timeline/persistence/GapWriter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/matrix/room/timeline/persistence/GapWriter.js b/src/matrix/room/timeline/persistence/GapWriter.js index 7a6ffeff..d769cbb5 100644 --- a/src/matrix/room/timeline/persistence/GapWriter.js +++ b/src/matrix/room/timeline/persistence/GapWriter.js @@ -123,7 +123,7 @@ export class GapWriter { } } - async _updateFragments(fragmentEntry, neighbourFragmentEntry, end, entries, txn) { + async _updateFragments(fragmentEntry, neighbourFragmentEntry, end, entries, txn, log) { const {direction} = fragmentEntry; const changedFragments = []; directionalAppend(entries, fragmentEntry, direction); @@ -131,6 +131,7 @@ export class GapWriter { if (neighbourFragmentEntry) { // if neighbourFragmentEntry was found, it means the events were overlapping, // so no pagination should happen anymore. + log.set("closedGapWith", neighbourFragmentEntry.fragmentId); neighbourFragmentEntry.token = null; fragmentEntry.token = null; @@ -189,7 +190,7 @@ export class GapWriter { } = await this._findOverlappingEvents(fragmentEntry, chunk, txn); // create entries for all events in chunk, add them to entries const {entries, updatedEntries} = await this._storeEvents(nonOverlappingEvents, lastKey, direction, state, txn, log); - const fragments = await this._updateFragments(fragmentEntry, neighbourFragmentEntry, end, entries, txn); + const fragments = await this._updateFragments(fragmentEntry, neighbourFragmentEntry, end, entries, txn, log); return {entries, updatedEntries, fragments}; }