{"record":{"id":"458f1eeae9b8613e","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-458f1e","errorCode":null,"errorMessage":"主题市场清单超过 {} 项限制","messagePattern":"主题市场清单超过 (.+?) 项限制","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":190,"sourceCode":"        theme.installed = local_theme.is_file();\n        theme.installed_version = if theme.installed {\n            records.themes.get(&theme.id).cloned().unwrap_or_default()\n        } else {\n            String::new()\n        };\n        theme.update_available = theme.installed\n            && !theme.installed_version.is_empty()\n            && theme.installed_version != theme.version;\n    }\n    manifest\n}\n\nfn validate_manifest(manifest: &mut DreamSkinMarketManifest) -> anyhow::Result<()> {\n    if manifest.schema_version != 1 {\n        bail!(\"不支持的主题市场清单版本\");\n    }\n    if manifest.themes.len() > MARKET_THEME_COUNT_LIMIT {\n        bail!(\"主题市场清单超过 {} 项限制\", MARKET_THEME_COUNT_LIMIT);\n    }\n    let mut ids = HashSet::new();\n    for theme in &mut manifest.themes {\n        validate_market_theme(theme)?;\n        if !ids.insert(theme.id.clone()) {\n            bail!(\"主题市场清单包含重复 ID：{}\", theme.id);\n        }\n        theme.preview_url = market_asset_url(DEFAULT_MARKET_RAW_BASE_URL, &theme.preview)?;\n    }\n    Ok(())\n}\n\nfn validate_market_theme(theme: &DreamSkinMarketTheme) -> anyhow::Result<()> {\n    if !valid_theme_id(&theme.id) {\n        bail!(\"主题市场包含无效 ID：{}\", theme.id);\n    }\n    for (label, value, limit) in [\n        (\"名称\", theme.name.as_str(), 100usize),","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_market.rs#L172-L208","documentation":"validate_manifest caps the number of themes a market manifest may contain at MARKET_THEME_COUNT_LIMIT. Oversized manifests are rejected to bound download/render cost and prevent abuse from a hostile market source.","triggerScenarios":"fetch_market_manifest or read_cached_manifest receives a manifest whose themes array exceeds MARKET_THEME_COUNT_LIMIT — usually a rogue/misconfigured market source, an aggregated manifest merging many publishers, or a fixture used in tests.","commonSituations":"A self-hosted market accidentally publishes its full theme archive index; someone concatenates multiple manifests; a malicious mirror inflates the list to stress the client.","solutions":["Split the market catalog into multiple manifests, each within the theme-count limit","Have the market publisher prune deprecated/unlisted themes so the count fits the limit","If you operate a mirror, filter the manifest to the themes you intend to serve before publishing","Check whether you fetched the wrong (archive/index) URL instead of the curated manifest"],"exampleFix":"// before\n{ \"schemaVersion\": 1, \"themes\": [ /* 500 entries > limit */ ] }\n// after — paginate/split\n{ \"schemaVersion\": 1, \"themes\": [ /* <= MARKET_THEME_COUNT_LIMIT entries */ ] }","handlingStrategy":"validation","validationCode":"if manifest.themes.len() > MARKET_THEME_COUNT_LIMIT {\n    return Err(anyhow::anyhow!(\"manifest has {} themes, limit is {}\", manifest.themes.len(), MARKET_THEME_COUNT_LIMIT));\n}","typeGuard":null,"tryCatchPattern":"match fetch_market_manifest(url).await {\n    Ok(m) => use_manifest(m),\n    Err(e) if e.to_string().contains(\"项限制\") => {\n        eprintln!(\"market manifest too large — use a curated/filtered source\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep published manifests within the theme-count limit; prune deprecated entries","Never concatenate multiple manifests into one document","Filter third-party/mirror manifests before serving them","Alert in publisher CI when the catalog grows near the limit"],"tags":["marketplace","limits","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}