{"record":{"id":"605a5b8ca2cd5f37","repo":"jackwener/OpenCLI","slug":"reddit-subscriptions-row-index-1-was-missing-605a5b","errorCode":null,"errorMessage":"Reddit subscriptions row ${index + 1} was missing subreddit identity.","messagePattern":"Reddit subscriptions row (.+?) was missing subreddit identity\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/reddit/subscribed.js","lineNumber":43,"sourceCode":"\nfunction mapSubredditRow(entry, index) {\n    const data = entry?.data;\n    if (!data || typeof data !== 'object') {\n        throw new CommandExecutionError(`Reddit subscriptions row ${index + 1} was missing data.`);\n    }\n    const fullname = typeof data.name === 'string' ? data.name : '';\n    const id = fullname.startsWith('t5_')\n        ? fullname\n        : (entry?.kind === 't5' && typeof data.id === 'string' && data.id ? `t5_${data.id}` : '');\n    const displayName = typeof data.display_name === 'string' && data.display_name\n        ? data.display_name\n        : '';\n    const subreddit = typeof data.display_name_prefixed === 'string' && data.display_name_prefixed\n        ? data.display_name_prefixed\n        : (displayName ? `r/${displayName}` : '');\n    const path = typeof data.url === 'string' && data.url.startsWith('/r/') ? data.url : '';\n    if (!id || !displayName || !subreddit || !path) {\n        throw new CommandExecutionError(`Reddit subscriptions row ${index + 1} was missing subreddit identity.`);\n    }\n    return {\n        id,\n        subreddit,\n        title: typeof data.title === 'string' ? data.title : '',\n        subscribers: typeof data.subscribers === 'number' ? data.subscribers : null,\n        description: typeof data.public_description === 'string' ? data.public_description.slice(0, 200) : '',\n        url: 'https://www.reddit.com' + path,\n    };\n}\n\ncli({\n    site: 'reddit',\n    name: 'subscribed',\n    description: 'List subreddits you are subscribed to',\n    access: 'read',\n    domain: 'reddit.com',\n    strategy: Strategy.COOKIE,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/reddit/subscribed.js#L25-L61","documentation":"CommandExecutionError thrown by mapSubredditRow when a subscription entry's data object exists but lacks one of the identity fields the library requires: id (t5_ fullname or t5 derivable), display_name, display_name_prefixed (or derivable), and a /r/-prefixed url. This guarantees every output row has a complete, unique subreddit identity.","triggerScenarios":"A child entry in subscriptions.json whose data is present but missing/in the wrong type one of: name/id, display_name, display_name_prefixed, or url not starting with '/r/'. Typically Reddit schema drift or partially-populated rows for newly-created or hidden subs.","commonSituations":"Reddit API changes renaming/moving fields; brand-new subreddits with incomplete about payloads; cached or stale responses via proxies; non-standard entries in the mine/subscriptions listing.","solutions":["Retry — if it is a transient partially-populated payload it may resolve","Inspect the raw payload at /subreddits/mine/subscriptions.json?raw_json=1 while logged in to see which field is missing for the offending row","Update the library to a version matching the current Reddit schema","Lower --limit or run repeatedly to narrow which specific subscription produces the malformed row, then check that subreddit's status directly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check payload shape yourself before mapping\nconst d = await page.evaluate(`fetch('/subreddits/mine/subscriptions.json?limit=1&raw_json=1',{credentials:'include'}).then(r=>r.json())`);\nconst c = d?.data?.children?.[0];\nif (c && !(c.data?.name && c.data?.display_name && c.data?.url?.startsWith('/r/'))) console.warn('identity fields incomplete in payload');","typeGuard":"function hasSubredditIdentity(entry){\n  const d = entry?.data;\n  return !!d && typeof d === 'object'\n    && typeof d.display_name === 'string' && d.display_name\n    && typeof d.url === 'string' && d.url.startsWith('/r/')\n    && (typeof d.name === 'string' && d.name.startsWith('t5_') || typeof d.id === 'string' && d.id);\n}","tryCatchPattern":"try { const rows = await cli.redditSubscribed({ limit }); }\ncatch (e) {\n  if (/was missing subreddit identity\\.$/.test(e.message)) { console.warn('schema drift detected; update library'); return null; }\n  throw e;\n}","preventionTips":["Pin/update the library so mapping tracks current Reddit field names","Filter for entries with complete identity fields in custom embeddings before emitting rows","Watch for brand-new subreddits with incomplete about payloads","Compare raw subscriptions.json output when the error persists to identify the offending row"],"tags":["reddit","malformed-response","schema-change","data-integrity"],"backgroundTag":"schema-validation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}