diff --git a/packages/core/src/lib/waku_store/index.ts b/packages/core/src/lib/waku_store/index.ts index 95ea807448..b4a5626fa9 100644 --- a/packages/core/src/lib/waku_store/index.ts +++ b/packages/core/src/lib/waku_store/index.ts @@ -309,9 +309,8 @@ async function* paginate( } let currentCursor = cursor; - while (true) { - queryOpts = Object.assign(queryOpts, { currentCursor }); + queryOpts.cursor = currentCursor; const stream = await connection.newStream(protocol); const historyRpcQuery = HistoryRPC.createQuery(queryOpts);