{"record":{"id":"c1121e2c02c51aec","repo":"jackwener/OpenCLI","slug":"please-verify-your-linux-do-session-is-still-valid","errorCode":null,"errorMessage":"Please verify your linux.do session is still valid","messagePattern":"Please verify your linux\\.do session is still valid","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/linux-do/feed.js","lineNumber":109,"sourceCode":"      };\n    } catch (error) {\n      return {\n        ok: false,\n        error: error instanceof Error ? error.message : String(error),\n      };\n    }\n  })()`);\n    if (!result) {\n        throw new CommandExecutionError('linux.do returned an empty browser response');\n    }\n    if (result.status === 401 || result.status === 403) {\n        throw new AuthRequiredError('linux.do', 'linux.do requires an active signed-in browser session');\n    }\n    if (!result.ok) {\n        throw new CommandExecutionError(result.error || `linux.do request failed: HTTP ${result.status ?? 'unknown'}`);\n    }\n    if (result.error) {\n        throw new CommandExecutionError(result.error, 'Please verify your linux.do session is still valid');\n    }\n    return result.data;\n}\nfunction findMatchingTag(records, value) {\n    const raw = value.trim();\n    const normalized = normalizeLookupValue(value);\n    return /^\\d+$/.test(raw)\n        ? records.find((item) => item.id === Number(raw)) ?? null\n        : records.find((item) => normalizeLookupValue(item.name) === normalized)\n            ?? records.find((item) => normalizeLookupValue(item.slug) === normalized)\n            ?? null;\n}\nfunction findMatchingCategory(records, value) {\n    const raw = value.trim();\n    const normalized = normalizeLookupValue(value);\n    return /^\\d+$/.test(raw)\n        ? records.find((item) => item.id === Number(raw)) ?? null\n        : records.find((item) => categoryLookupKeys(item).includes(normalized))","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linux-do/feed.js#L91-L127","documentation":"This is the remediation hint attached to a CommandExecutionError raised when the browser response is not ok but carries an error payload (result.error set). The primary message is the underlying error from the browser fetch; 'Please verify your linux.do session is still valid' is the human-facing hint. The library assumes most non-auth non-ok outcomes with error text stem from a degraded or stale session.","triggerScenarios":"fetchLinuxDoJson receives result.ok === false AND result.error is a non-empty string (e.g. the browser wrapper reports 'not logged in', 'blocked by Cloudflare', or a navigation failure); raised from any linux-do command consuming data or subData.","commonSituations":"linux.do invalidated the session mid-use; the automated browser hit a Cloudflare challenge; the browser profile's cookies were partially cleared; a headless browser failed navigation but returned error text with a non-ok flag.","solutions":["Sign in again to linux.do in the browser the CLI automates to refresh the session","Re-run the same command after re-authenticating; transient challenges usually clear","Inspect the primary error text above the hint for the real cause (block page, navigation failure, etc.)","If it persists, use a regular (non-headless) browser profile and confirm the site loads manually"],"exampleFix":"// before\nthrow new CommandExecutionError(result.error); // opaque failure, user can't tell why\n// after (already handled by library)\nthrow new CommandExecutionError(result.error, 'Please verify your linux.do session is still valid');\n// user action: re-login to linux.do in the automated browser, then retry","handlingStrategy":"try-catch","validationCode":"// Verify session before the call\nconst probe = await execCommand(`(async () => {\n    const r = await fetch('https://linux.do/session/current.json');\n    return { ok: r.ok, status: r.status };\n})()`);\nif (!probe || !probe.ok) throw new Error('linux.do session invalid — re-login in the automated browser');","typeGuard":"function isSessionValidResult(result) {\n    return Boolean(result) && typeof result === 'object' &&\n        result.ok === true && typeof result.data !== 'undefined';\n}","tryCatchPattern":"import { CommandExecutionError } from '@jackwener/opencli/errors';\ntry {\n    const topics = await data();\n} catch (err) {\n    if (err instanceof CommandExecutionError && /verify your linux\\.do session/.test(String(err.hint || err.message))) {\n        console.error('Session degraded — sign in to linux.do again in the automated browser, then retry.');\n    } else {\n        throw err;\n    }\n}","preventionTips":["Re-login to linux.do whenever the CLI reports session-related hints","Use a persistent browser profile so cookies survive restarts","Avoid running the CLI during Cloudflare challenge storms; complete challenges manually first","Don't partially clear browser storage for the profile the CLI drives"],"tags":["authentication","browser-session","cli","session-expired"],"backgroundTag":"session-expired","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}