{"record":{"id":"98f8969915d8d154","repo":"BigPizzaV3/CodexPlusPlus","slug":"dreamskin","errorCode":null,"errorMessage":"DreamSkin 主题版本与请求不一致","messagePattern":"DreamSkin 主题版本与请求不一致","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_community.rs","lineNumber":151,"sourceCode":"pub async fn install_community_theme(\n    state_dir: &Path,\n    version_id: &str,\n) -> anyhow::Result<DreamSkinThemeSummary> {\n    validate_version_id(version_id)?;\n    let client = community_http_client(Duration::from_secs(120))?;\n    let metadata_url = format!(\"{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}\");\n    let metadata_bytes = download_limited(\n        &client,\n        &metadata_url,\n        METADATA_BYTES_LIMIT,\n        \"application/json\",\n    )\n    .await?;\n    let metadata: DreamSkinCommunityTheme =\n        serde_json::from_slice(&metadata_bytes).context(\"DreamSkin 主题元数据不是有效 JSON\")?;\n    validate_community_theme(&metadata)?;\n    if metadata.id != version_id {\n        bail!(\"DreamSkin 主题版本与请求不一致\");\n    }\n    if !metadata.apply_compatible {\n        bail!(\"该主题是旧格式，只支持在线预览或手动下载\");\n    }\n\n    let download_url = format!(\"{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}/download\");\n    let package = download_limited(\n        &client,\n        &download_url,\n        metadata.package_bytes,\n        \"application/zip\",\n    )\n    .await?;\n    if package.len() != metadata.package_bytes {\n        bail!(\"DreamSkin 主题包实际大小与审核元数据不一致\");\n    }\n    let actual_sha = format!(\"{:x}\", Sha256::digest(&package));\n    if !actual_sha.eq_ignore_ascii_case(&metadata.package_sha256) {","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_community.rs#L133-L169","documentation":"install_community_theme fetched GET /v1/themes/{version_id}; the returned metadata's id must equal the requested version_id. A mismatch means the server resolved the request to a different theme version than asked for - a republished or renamed version, or catalog/CDN skew.","triggerScenarios":"Reinstalling a version id from a stale cached catalog after the author republished the theme; metadata and detail endpoints serving inconsistent records; hand-crafted version ids.","commonSituations":"A locally cached catalog.json lagging behind gallery re-publishes; old share links pointing at superseded versions.","solutions":["Reload the community catalog (bypass the cache) and retry with the fresh id","If it still mismatches, the gallery's metadata for that id is inconsistent - report it","Install using ids taken from the same catalog fetch you are browsing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Catch the '主题版本与请求不一致' error, invalidate the cached catalog, re-fetch the theme list, and retry once with the id now associated with the theme; if the retry hits the same error, surface the mismatch instead of looping.","preventionTips":["Install from a freshly fetched catalog, not a cached one","Treat id drift as a signal to refresh, not as user error"],"tags":["dreamskin","community-api","metadata-mismatch","rust"],"backgroundTag":"metadata-id-mismatch","analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}