{"record":{"id":"630eafa27fec7c96","repo":"BigPizzaV3/CodexPlusPlus","slug":"name-630eaf","errorCode":null,"errorMessage":"主题包文件 {name} 超过大小限制","messagePattern":"主题包文件 (.+?) 超过大小限制","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":129,"sourceCode":"        if file.is_dir() {\n            entries.push((name, None));\n            continue;\n        }\n        let base_name = name.rsplit('/').next().unwrap_or_default();\n        if base_name == \".DS_Store\" || name.starts_with(\"__MACOSX/\") {\n            entries.push((name, None));\n            continue;\n        }\n        if !ALLOWED_FILES.contains(&base_name) {\n            bail!(\"主题包包含不支持的文件：{name}\");\n        }\n        let limit = file_limit(base_name);\n        let mut content = Vec::new();\n        file.take((limit + 1) as u64)\n            .read_to_end(&mut content)\n            .context(\"读取 Dream Skin ZIP 内容失败\")?;\n        if content.is_empty() || content.len() > limit {\n            bail!(\"主题包文件 {name} 超过大小限制\");\n        }\n        unpacked = unpacked.saturating_add(content.len());\n        if unpacked > UNPACKED_LIMIT {\n            bail!(\"Dream Skin 主题包解包后超过 64 MiB 限制\");\n        }\n        entries.push((name, Some(content)));\n    }\n\n    let mut files = normalize_package_entries(entries)?;\n\n    let manifest_bytes = files\n        .remove(\"manifest.json\")\n        .context(\"主题包缺少 manifest.json\")?;\n    let theme_bytes = files\n        .remove(\"theme.json\")\n        .context(\"主题包缺少 theme.json\")?;\n    let css_bytes = files.remove(\"theme.css\").context(\"主题包缺少 theme.css\")?;\n    let image_name = [\"background.webp\", \"background.jpg\", \"background.png\"]","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_package.rs#L111-L147","documentation":"Each allowed file is read with a per-file limit from file_limit(base_name); if the content is empty or exceeds that per-entry limit, this error names the offending file. Note the same message covers the empty-content case, so an empty allowed file also triggers it.","triggerScenarios":"A ZIP entry of an allowed type whose decompressed size exceeds file_limit(base_name), or whose content is empty (0 bytes), during validate_and_read_package.","commonSituations":"Oversized background image or css in the theme; a zero-byte file produced by a failed build or interrupted download; accidentally zipping a placeholder file.","solutions":["Shrink the offending file (compress the image, minify css) to fit its per-file limit","Ensure every included file is non-empty — regenerate or re-download it","Check which per-file limit applies via file_limit(base_name) and compare with actual size","Re-export the asset at lower resolution/quality"],"exampleFix":"// before: background.png = 20 MiB (limit smaller)\n// after\nconvert background.png -quality 80 background.webp  # under limit","handlingStrategy":"validation","validationCode":"let limit = file_limit(base_name);\nif content.is_empty() {\n    return Err(EmptyFile(name.to_string()));\n}\nif content.len() > limit {\n    return Err(FileTooLarge(name.to_string(), content.len(), limit));\n}","typeGuard":null,"tryCatchPattern":"match validate_and_read_package(&bytes, platform) {\n    Err(e) if e.to_string().contains(\"超过大小限制\") => {\n        Err(UserFacingError::AssetTooLarge(extract_name(&e)))\n    }\n    other => other,\n}","preventionTips":["Check each file's size against file_limit() at packaging time","Never ship zero-byte files; verify build output completeness","Optimize assets (webp, minified css) before packaging"],"tags":["validation","size-limit","zip"],"backgroundTag":"file-size-limit-exceeded","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"}