{"record":{"id":"c136d8071136b7b5","repo":"jackwener/OpenCLI","slug":"browser-session-required-for-linkedin-salesnav-inb","errorCode":null,"errorMessage":"Browser session required for linkedin salesnav-inbox","messagePattern":"Browser session required for linkedin salesnav-inbox","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/linkedin/salesnav-inbox.js","lineNumber":182,"sourceCode":"\nexport { THREAD_DECORATION, THREADS_BASE };\n\ncli({\n  site: 'linkedin',\n  name: 'salesnav-inbox',\n  access: 'read',\n  description: 'List LinkedIn Sales Navigator message conversations with API pagination',\n  domain: LINKEDIN_DOMAIN,\n  strategy: Strategy.UI,\n  browser: true,\n  args: [\n    { name: 'limit', type: 'number', default: DEFAULT_LIMIT, help: 'Maximum conversations to return (1-500)' },\n    { name: 'max-pages', type: 'number', default: 30, help: 'Maximum Sales Navigator API pages to fetch' },\n    { name: 'unread-only', type: 'bool', default: false, help: 'Return only unread conversations' },\n  ],\n  columns: ['rank', 'thread_id', 'thread_url', 'person_name', 'last_message_snippet', 'last_activity_time', 'unread', 'unread_count', 'total_message_count', 'archived', 'participants', 'next_page_starts_at'],\n  func: async (page, args) => {\n    if (!page) throw new CommandExecutionError('Browser session required for linkedin salesnav-inbox');\n    const limit = parseLimit(args.limit);\n    const maxPages = parseLimit(args['max-pages'], 30);\n    await page.goto(SALES_INBOX_URL);\n    await page.wait(4);\n    let rows = await fetchInboxRows(page, { limit, maxPages });\n    if (args['unread-only']) rows = rows.filter((row) => row.unread);\n    if (rows.length === 0) {\n      if (args['unread-only']) return [];\n      throw new EmptyResultError('linkedin salesnav-inbox', 'No Sales Navigator conversations were found.');\n    }\n    return rows.slice(0, limit).map((row, index) => ({ ...row, rank: index + 1 }));\n  },\n});\n\nexport const __test__ = {\n  THREAD_DECORATION,\n  normalizeWhitespace,\n  parseLimit,","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linkedin/salesnav-inbox.js#L164-L200","documentation":"The salesnav-inbox command's func requires an active Playwright-style browser page to drive the Sales Navigator UI. If page is null/undefined the command cannot navigate to SALES_INBOX_URL, so it throws a CommandExecutionError immediately.","triggerScenarios":"Calling the command's func with page undefined — i.e., no logged-in browser session was supplied to the CLI runner.","commonSituations":"Running the command without first opening/authenticating a browser session (e.g. missing linkedin login step); invoking func programmatically without passing a page object; session was closed before the command ran.","solutions":["Start/authenticate a browser session for linkedin commands before running salesnav-inbox (e.g. via the CLI's login/session flow).","Re-run the command normally through the CLI so it receives a live page object.","If calling func directly, pass the authenticated page instance as the first argument."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!page) throw new Error('Open and authenticate a browser session before running salesnav-inbox');","typeGuard":"function hasPage(page) { return Boolean(page && typeof page.goto === 'function' && typeof page.wait === 'function'); }","tryCatchPattern":"try { await run('linkedin salesnav-inbox'); } catch (e) { if (/Browser session required/.test(e.message)) { await login(); await run('linkedin salesnav-inbox'); } else throw e; }","preventionTips":["Always establish and authenticate the browser session before linkedin commands.","Never pass null/undefined page when calling func directly.","Re-login if the session was closed or expired.","Script the session setup as a prerequisite step in automation."],"tags":["browser-session","authentication","sales-navigator"],"backgroundTag":"missing-browser-session","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}