{"record":{"id":"addf740a80ce4080","repo":"jackwener/OpenCLI","slug":"xiaohongshu-account-scoped-filter-was-unavailable","errorCode":null,"errorMessage":"Xiaohongshu account-scoped filter was unavailable (${detail}); verify login and account access.","messagePattern":"Xiaohongshu account-scoped filter was unavailable \\((.+?)\\); verify login and account access\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/xiaohongshu/search.js","lineNumber":516,"sourceCode":"    const result = unwrapEvaluateResult(payload);\n    if (!result || typeof result !== 'object' || Array.isArray(result) || typeof result.status !== 'string') {\n        throw new CommandExecutionError('Unexpected Xiaohongshu search filter result shape.');\n    }\n    if (result.status === 'ok') {\n        return;\n    }\n    const detail = typeof result.detail === 'string' ? result.detail : 'unknown';\n    if (result.status === 'auth') {\n        throw new AuthRequiredError('www.xiaohongshu.com', 'Xiaohongshu search filters require a logged-in browser session');\n    }\n    if (result.status === 'timeout') {\n        throw new TimeoutError(`xiaohongshu search filter ${detail}`, FILTER_SETTLE_SECONDS);\n    }\n    if (result.status === 'location') {\n        throw new CommandExecutionError(`Xiaohongshu location filter was not applied (${detail}); enable browser geolocation permission.`);\n    }\n    if (result.status === 'capability') {\n        throw new CommandExecutionError(`Xiaohongshu account-scoped filter was unavailable (${detail}); verify login and account access.`);\n    }\n    if (result.status === 'inactive') {\n        throw new CommandExecutionError(`Xiaohongshu search filter chip did not become active (${detail}).`);\n    }\n    throw new CommandExecutionError(`Xiaohongshu search filter layout did not match the expected visible panel (${detail}).`);\n}\n/**\n * Build a \"scroll until enough or plateaued\" IIFE used in place of a fixed\n * `autoScroll({ times: N })`. Xiaohongshu's search results page lazy-loads\n * ~5-7 notes per scroll, so the previous `times: 2` capped extraction at\n * ~13 items regardless of `--limit` (see #1471). This helper drives scrolls\n * dynamically:\n *\n *   - count visible `section.note-item` rows (excluding related-search\n *     `.query-note-item` rows)\n *   - if count >= targetCount → break (got enough)\n *   - if two consecutive scrolls add no new rows → break (DOM plateaued,\n *     no more lazy-load available)","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xiaohongshu/search.js#L498-L534","documentation":"When the filter-application script reports status 'capability', requireFilterApplication throws this CommandExecutionError indicating an account-scoped filter was unavailable. Some filters depend on account-level features or entitlements that the current logged-in account does not have, and the page could not expose the filter control.","triggerScenarios":"The in-page script returns {status:'capability', detail:...} when a filter option is missing from the rendered panel despite being requested — the logged-in account lacks the feature, the filter is region/experiment-gated, or the account type (e.g. unverified) cannot use it.","commonSituations":"Newly registered or restricted accounts lacking advanced search facets; A/B experiments where the filter UI isn't rendered for the account; region-locked filters; requesting a filter option that exists in code but is no longer offered to the account.","solutions":["Verify the filter appears manually when logged into the same account in a normal browser; if not, the account lacks it","Try a different/fully-featured account or a different region","Remove the account-scoped filter from the search arguments and rely on filters the account supports","If Xiaohongshu removed the feature, stop using the filter and update SEARCH_FILTERS accordingly"],"exampleFix":"// before\nawait search({ query: 'coffee', filters: { advanced: 'creator' } }); // account lacks this facet\n// after\ntry {\n  await search({ query: 'coffee', filters: { advanced: 'creator' } });\n} catch (e) {\n  if (e.message.includes('account-scoped filter was unavailable')) {\n    return search({ query: 'coffee' }); // degrade gracefully without the filter\n  }\n  throw e;\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await collectSearchHarvest(query, { ...filters, accountScoped: 'x' });\n} catch (e) {\n  if (e.message.includes('account-scoped filter was unavailable')) {\n    console.warn('account lacks this filter; retrying without it');\n    return collectSearchHarvest(query, filters);\n  }\n  throw e;\n}","preventionTips":["Verify each filter is manually visible for the logged-in account before automating it","Maintain a per-account allowlist of supported filters","Degrade gracefully: retry searches without account-scoped filters when unavailable","Track Xiaohongshu feature experiments/region gates that toggle filter availability"],"tags":["capability","account-restrictions","filters","scraping"],"backgroundTag":"feature-not-available-for-account","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}