{"record":{"id":"cffd6a7bca21895f","repo":"jackwener/OpenCLI","slug":"no-notifications-found-cffd6a","errorCode":null,"errorMessage":"No notifications found","messagePattern":"No notifications found","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/jike/notifications.js","lineNumber":110,"sourceCode":"}\n\nasync function listNotifications(page, limit) {\n    const rows = [];\n    const seenIds = new Set();\n    const seenCursors = new Set();\n    let loadMoreKey = null;\n    for (let pageIndex = 0; pageIndex < MAX_PAGES; pageIndex++) {\n        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',","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/jike/notifications.js#L92-L128","documentation":"listNotifications paginates through the Jike notifications feed until `limit` rows are collected. When the API stops providing a loadMoreKey cursor and zero notifications were collected, the library throws EmptyResultError rather than returning an empty list, signaling that the account genuinely has no notifications.","triggerScenarios":"Calling `jike notifications` for an account with no notifications at all (rows.length === 0 when loadMoreKey is null), typically on the first page with an empty feed.","commonSituations":"A brand-new or rarely used Jike account; filters or types that exclude all existing notifications; a wrong/secondary account configured so the feed is empty.","solutions":["Verify the intended account has notifications (check in the Jike app)","Remove or widen filters/limit options that may exclude results","Handle EmptyResultError explicitly if an empty result is acceptable","Check which account/token is configured — ensure it is the expected one"],"exampleFix":"// before\ncli('jike', 'notifications').run();\n// after\ntry {\n  cli('jike', 'notifications').run();\n} catch (e) {\n  if (e.name === 'EmptyResultError') console.log('(no notifications)');\n  else throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await cli('jike', 'notifications').run();\n} catch (e) {\n  if (e.name === 'EmptyResultError' || String(e.message) === 'No notifications found') {\n    return []; // treat as empty, not fatal\n  }\n  throw e;\n}","preventionTips":["Treat empty results as expected for inactive accounts","Confirm the configured account/token matches the intended user","Avoid over-filtering with restrictive limit/type options"],"tags":["empty-result","pagination","jike"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}