Skip to content

Commit d75fde2

Browse files
committed
fix(global-search): use exclusive lower bound for keyRange to prevent re-processing of startKey
1 parent 792fa65 commit d75fde2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • plugins/global-search/src/utils

plugins/global-search/src/utils/db.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export class GlobalSearchDatabase implements ResumableAsyncIterable<IndexEntry>
5050
const tx = db.transaction("entries", "readonly")
5151
const store = tx.objectStore("entries")
5252

53-
const keyRange = startKey ? IDBKeyRange.lowerBound(startKey) : undefined
53+
// Use exclusive lower bound (true) to avoid re-processing the startKey item when resuming
54+
const keyRange = startKey ? IDBKeyRange.lowerBound(startKey, true) : undefined
5455
let cursor = await store.openCursor(keyRange)
5556

5657
try {

0 commit comments

Comments
 (0)