{"record":{"id":"47831d489dc38055","repo":"BigPizzaV3/CodexPlusPlus","slug":"dreamskin-47831d","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":368,"sourceCode":"    }\n}\n\nfn cache_catalog(state_dir: &Path, catalog: &DreamSkinCommunityCatalog) -> anyhow::Result<()> {\n    let path = state_dir.join(CACHE_FILE);\n    if let Some(parent) = path.parent() {\n        std::fs::create_dir_all(parent)?;\n    }\n    crate::settings::atomic_write(&path, &serde_json::to_vec(catalog)?)\n}\n\nfn read_cached_catalog(state_dir: &Path) -> anyhow::Result<DreamSkinCommunityCatalog> {\n    let path = state_dir.join(CACHE_FILE);\n    let metadata = std::fs::symlink_metadata(&path)?;\n    if !metadata.file_type().is_file()\n        || metadata.file_type().is_symlink()\n        || metadata.len() as usize > CATALOG_BYTES_LIMIT\n    {\n        bail!(\"DreamSkin 社区缓存无效\");\n    }\n    let catalog: DreamSkinCommunityCatalog = serde_json::from_slice(&std::fs::read(path)?)?;\n    validate_catalog(&catalog.items)?;\n    Ok(catalog)\n}\n\nfn community_http_client(timeout: Duration) -> anyhow::Result<reqwest::Client> {\n    Ok(reqwest::Client::builder()\n        .user_agent(format!(\n            \"CodexPlusPlus/{} DreamSkin\",\n            env!(\"CARGO_PKG_VERSION\")\n        ))\n        .redirect(reqwest::redirect::Policy::none())\n        .connect_timeout(Duration::from_secs(8))\n        .timeout(timeout)\n        .build()?)\n}\n","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_community.rs#L350-L386","documentation":"Raised in read_cached_catalog: the locally cached DreamSkin community catalog file in the state dir failed safety checks — not a regular file, is a symlink, or otherwise fails validation — so the cache cannot be trusted and is rejected.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_community.rs:368 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the cache file in the state dir to force a fresh fetch","Check for symlink attacks or corruption in the state dir","Retry the catalog load after clearing the cache"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}