{"record":{"id":"f5d18ab73e627e25","repo":"jackwener/OpenCLI","slug":"xueqiu-comments-pagination-stopped-after-request-f5d18a","errorCode":null,"errorMessage":"xueqiu comments pagination stopped after request ${requestNumber}, collected ${collected}/${target} items, reason: pagination did not advance","messagePattern":"xueqiu comments pagination stopped after request (.+?), collected (.+?)/(.+?) items, reason: pagination did not advance","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"clis/xueqiu/comments.js","lineNumber":288,"sourceCode":"            }\n            break;\n        }\n        let advanced = false;\n        for (const row of pageRows) {\n            if (seenIds.has(row.id))\n                continue;\n            seenIds.add(row.id);\n            rows.push(row);\n            advanced = true;\n        }\n        if (rows.length >= options.limit) {\n            return rows.slice(0, options.limit);\n        }\n        if (rawItems.length < options.pageSize) {\n            break;\n        }\n        if (!advanced) {\n            warn(buildPaginationStopMessage(requestNumber, rows.length, options.limit, 'pagination did not advance'));\n            break;\n        }\n        if (requestNumber === options.maxRequests) {\n            warn(buildPaginationStopMessage(requestNumber, rows.length, options.limit, 'reached safety cap'));\n        }\n    }\n    return rows.slice(0, options.limit);\n}\ncli({\n    site: 'xueqiu',\n    name: 'comments',\n    access: 'read',\n    description: '获取单只股票的讨论动态',\n    domain: 'xueqiu.com',\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xueqiu/comments.js#L270-L306","documentation":"A warning emitted when a fetched page contains rows but none of them advanced pagination: every row id was already in seenIds, so the loop stops with reason 'pagination did not advance'. It protects against infinite loops when xueqiu keeps returning the same page.","triggerScenarios":"During collectCommentRows, a page (rawItems.length >= pageSize) yields only duplicate ids already collected — typically when the page token/next-page cursor is ignored by the site or the sort order resets between requests.","commonSituations":"Hot discussion threads where new comments shift the first page so the cursor re-serves seen items; xueqiu ignoring the page parameter for large threads; stale session causing cached responses.","solutions":["Accept the partial result — collected rows up to the duplicate point are returned","Reduce --page-size so the cursor advances within the site's supported window","Check whether the thread genuinely has fewer comments than --limit and lower the target","Update the client to use xueqiu's current pagination parameter name"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { rows = await collectCommentRows(opts); } catch (e) { if (rows.length) usePartial(rows); else throw e; }","preventionTips":["Set --limit no higher than the thread's actual comment count","Use the largest --page-size the site supports","Re-check sort/order assumptions for fast-moving threads"],"tags":["pagination","duplicate-data","scraping"],"backgroundTag":"pagination-did-not-advance","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}