forked from mystiq/hydrogen-web
log neighbor fragment id when closing gap
This commit is contained in:
parent
c6ed0abfd7
commit
0d798178b0
1 changed files with 3 additions and 2 deletions
|
@ -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 {direction} = fragmentEntry;
|
||||||
const changedFragments = [];
|
const changedFragments = [];
|
||||||
directionalAppend(entries, fragmentEntry, direction);
|
directionalAppend(entries, fragmentEntry, direction);
|
||||||
|
@ -131,6 +131,7 @@ export class GapWriter {
|
||||||
if (neighbourFragmentEntry) {
|
if (neighbourFragmentEntry) {
|
||||||
// if neighbourFragmentEntry was found, it means the events were overlapping,
|
// if neighbourFragmentEntry was found, it means the events were overlapping,
|
||||||
// so no pagination should happen anymore.
|
// so no pagination should happen anymore.
|
||||||
|
log.set("closedGapWith", neighbourFragmentEntry.fragmentId);
|
||||||
neighbourFragmentEntry.token = null;
|
neighbourFragmentEntry.token = null;
|
||||||
fragmentEntry.token = null;
|
fragmentEntry.token = null;
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ export class GapWriter {
|
||||||
} = await this._findOverlappingEvents(fragmentEntry, chunk, txn);
|
} = await this._findOverlappingEvents(fragmentEntry, chunk, txn);
|
||||||
// create entries for all events in chunk, add them to entries
|
// create entries for all events in chunk, add them to entries
|
||||||
const {entries, updatedEntries} = await this._storeEvents(nonOverlappingEvents, lastKey, direction, state, txn, log);
|
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};
|
return {entries, updatedEntries, fragments};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue