{"record":{"id":"8838342c1c4f50a0","repo":"BigPizzaV3/CodexPlusPlus","slug":"dreamskin-883834","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":166,"sourceCode":"        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) {\n        bail!(\"DreamSkin 主题包 SHA-256 与审核元数据不一致\");\n    }\n    let validated = crate::dream_skin_package::validate_and_read_package(\n        &package,\n        if cfg!(windows) { \"windows\" } else { \"macos\" },\n    )?;\n    if validated.manifest.theme_id != metadata.theme_id\n        || validated.manifest.version != metadata.version\n    {\n        bail!(\"DreamSkin 主题包身份与审核元数据不一致\");\n    }\n    crate::dream_skin_library::save_validated_dream_skin_package(state_dir, &validated)\n}\n\npub fn import_theme_package(","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_community.rs#L148-L184","documentation":"The downloaded package's byte length must exactly equal metadata.package_bytes from the reviewed metadata (which also served as the download cap). A different length means a truncated transfer or an artifact that changed server-side after review; the install aborts before the zip is parsed.","triggerScenarios":"Connection cut mid-download inside the 120-second window; the zip re-uploaded after review with a different size; a proxy or antivirus altering the body.","commonSituations":"Flaky networks during multi-MiB downloads; corporate proxies rewriting zips; gallery artifact updated between catalog fetch and install.","solutions":["Retry the install - truncation is the common cause and a retry re-downloads","Refresh the catalog so metadata and artifact re-sync, then retry","A persistent mismatch means reviewed metadata is stale - report the theme"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"On the '实际大小与审核元数据不一致' error, retry install_community_theme once or twice with freshly fetched metadata; a stable mismatch is server-side artifact drift - surface it as a reportable gallery issue rather than retrying forever.","preventionTips":["Retry once on size mismatch before escalating","Size and SHA together form the integrity gate the library enforces for you"],"tags":["dreamskin","download-integrity","size-mismatch","rust"],"backgroundTag":"content-length-mismatch","analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}