{"record":{"id":"44aed8658e3a19b9","repo":"BigPizzaV3/CodexPlusPlus","slug":"id-44aed8","errorCode":null,"errorMessage":"主题市场清单包含重复 ID：{}","messagePattern":"主题市场清单包含重复 ID：(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":196,"sourceCode":"        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),\n        (\"版本\", theme.version.as_str(), 40usize),\n        (\"作者\", theme.author.as_str(), 100usize),\n        (\"许可证\", theme.license.as_str(), 100usize),\n    ] {\n        if value.trim().is_empty() || value.len() > limit {\n            bail!(\"市场主题 {} 的{}无效\", theme.id, label);","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_market.rs#L178-L214","documentation":"validate_manifest enforces unique theme IDs across the manifest. Each theme's id is inserted into a HashSet; a duplicate aborts validation so downstream lookup/install flows cannot be ambiguous about which record to use.","triggerScenarios":"fetch_market_manifest or read_cached_manifest processes a manifest where two themes share the same id — e.g. a publisher listed the same theme twice with different versions, or a merge of two manifests duplicated entries.","commonSituations":"Hand-edited market manifests; automated publishers re-emitting entries without deduplication; a mirror concatenating upstream and patched manifests.","solutions":["Deduplicate the manifest themes array, keeping a single entry per id (usually the newest version)","Ask the market publisher to fix their generation script to key entries by id","If merging manifests yourself, merge by id instead of concatenating arrays"],"exampleFix":"// before\nthemes: [ {id: \"cool-theme\", version: \"1.0\"}, {id: \"cool-theme\", version: \"1.1\"} ]\n// after\nthemes: [ {id: \"cool-theme\", version: \"1.1\"} ]","handlingStrategy":"validation","validationCode":"let ids: std::collections::HashSet<&str> = manifest.themes.iter().map(|t| t.id.as_str()).collect();\nif ids.len() != manifest.themes.len() {\n    return Err(anyhow::anyhow!(\"manifest contains duplicate theme ids\"));\n}","typeGuard":null,"tryCatchPattern":"match fetch_market_manifest(url).await {\n    Ok(m) => use_manifest(m),\n    Err(e) if e.to_string().contains(\"重复 ID\") => {\n        eprintln!(\"market manifest has duplicate ids — notify the publisher\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Key manifest generation on a map keyed by id so duplicates cannot be emitted","Deduplicate when merging upstream and patched manifests","Validate manifests in publisher CI before release"],"tags":["marketplace","validation","duplicate-keys"],"backgroundTag":"schema-validation-failed","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"}