{"record":{"id":"7a31aec6f27e040b","repo":"jackwener/OpenCLI","slug":"jike-notifications-pagination-returned-a-repeated","errorCode":null,"errorMessage":"Jike notifications pagination returned a repeated cursor","messagePattern":"Jike notifications pagination returned a repeated cursor","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/jike/notifications.js","lineNumber":118,"sourceCode":"        const body = await fetchNotificationsPage(page, loadMoreKey);\n        for (const notification of body.data) {\n            const row = mapNotification(notification);\n            if (seenIds.has(notification.id)) continue;\n            seenIds.add(notification.id);\n            rows.push(row);\n            if (rows.length >= limit) return rows;\n        }\n        const next = body.loadMoreKey;\n        if (next == null) {\n            if (rows.length === 0) throw new EmptyResultError('jike notifications', 'No notifications found');\n            return rows;\n        }\n        if (typeof next !== 'object' || Array.isArray(next)) {\n            throw new CommandExecutionError('Jike notifications API returned a malformed pagination cursor');\n        }\n        const cursorKey = JSON.stringify(next);\n        if (seenCursors.has(cursorKey)) {\n            throw new CommandExecutionError('Jike notifications pagination returned a repeated cursor');\n        }\n        seenCursors.add(cursorKey);\n        loadMoreKey = next;\n    }\n    throw new CommandExecutionError(`Jike notifications pagination exceeded ${MAX_PAGES} pages before satisfying --limit`);\n}\n\ncli({\n    site: 'jike',\n    name: 'notifications',\n    access: 'read',\n    description: '即刻通知',\n    domain: 'web.okjike.com',\n    strategy: Strategy.COOKIE,\n    browser: true,\n    args: [\n        { name: 'limit', type: 'int', default: DEFAULT_LIMIT },\n    ],","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/jike/notifications.js#L100-L136","documentation":"To prevent infinite loops, listNotifications tracks a set of JSON-serialized cursors and throws CommandExecutionError if the API hands back the same loadMoreKey again, since the feed would repeat forever without new data.","triggerScenarios":"The Jike notifications API repeatedly returns the identical loadMoreKey object across consecutive pages, so requesting the next page never advances.","commonSituations":"Server-side pagination bugs at Jike; accounts with huge notification counts where the backend can't advance; stale cached responses from a proxy; clock/deleted-item quirks causing the cursor to not change.","solutions":["Re-run later — often a transient server-side pagination hiccup","Use a smaller --limit so fewer pages are needed","Clear any proxy/cache that could replay the same response","Report to Jike if the same cursor is always returned; update the library if a workaround (e.g. cursor mutation) was shipped"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await cli('jike', 'notifications').run();\n} catch (e) {\n  if (String(e.message).includes('repeated cursor')) {\n    await sleep(5000); // transient server pagination bug often clears\n    // retry once, else surface to user\n  } else throw e;\n}","preventionTips":["Retry once with a delay before failing hard","Disable caches/proxies that could replay identical responses","Use smaller --limit to reduce pages required"],"tags":["pagination","infinite-loop-guard","jike"],"backgroundTag":"repeated-pagination-cursor","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}