{"record":{"id":"4ac8c8c5902c3d18","repo":"BigPizzaV3/CodexPlusPlus","slug":"unsupported-dream-skin-backup-schema","errorCode":null,"errorMessage":"unsupported Dream Skin backup schema","messagePattern":"unsupported Dream Skin backup schema","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin.rs","lineNumber":474,"sourceCode":"    theme.insert(\"fonts\", Value::InlineTable(fonts));\n    theme.insert(\"ink\", profile.ink.into());\n    theme.insert(\"opaqueWindows\", profile.opaque_windows.into());\n    theme.insert(\"semanticColors\", Value::InlineTable(semantic_colors));\n    theme.insert(\"surface\", profile.surface.into());\n    theme\n}\n\nfn serialize_item(item: &Item) -> String {\n    let mut document = DocumentMut::new();\n    document[\"value\"] = item.clone();\n    document.to_string()\n}\n\nfn parse_backup_item(backup: &DreamSkinThemeBackup, serialized: &str) -> anyhow::Result<Item> {\n    match backup.schema_version {\n        1 => parse_legacy_item(serialized),\n        BACKUP_SCHEMA_VERSION => parse_document_item(serialized),\n        _ => bail!(\"unsupported Dream Skin backup schema\"),\n    }\n}\n\nfn parse_legacy_item(serialized: &str) -> anyhow::Result<Item> {\n    match format!(\"value = {serialized}\\n\").parse::<DocumentMut>() {\n        Ok(mut document) => document\n            .remove(\"value\")\n            .context(\"serialized Dream Skin backup value is missing\"),\n        Err(_) => parse_legacy_table(serialized),\n    }\n}\n\nfn parse_legacy_table(serialized: &str) -> anyhow::Result<Item> {\n    let document = serialized.parse::<DocumentMut>()?;\n    Ok(Item::Table(document.as_table().clone()))\n}\n\nfn parse_document_item(serialized: &str) -> anyhow::Result<Item> {","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin.rs#L456-L492","documentation":"parse_backup_item dispatches on backup.schema_version: 1 takes the legacy TOML-value parser, BACKUP_SCHEMA_VERSION the current document parser; anything else bails. In the shipped call paths read_backup has already enforced the same set, so this is the defensive backstop for callers that hand-construct a DreamSkinThemeBackup.","triggerScenarios":"A backup written by a newer app reaching an older parser without read_backup's gate; unit tests or custom tooling constructing a backup struct with an arbitrary schema_version.","commonSituations":"Downgrade after an upgrade wrote a next-schema backup; direct struct-level use of the API in tests.","solutions":["Reinstall the app version that understands the backup's schema, or a newer one","Delete the backup file to reset Dream Skin state","File an issue including the schema_version value from the backup JSON"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"fn backup_schema_version(path: &std::path::Path) -> Option<u64> {\n    let bytes = std::fs::read(path).ok()?;\n    serde_json::from_slice::<serde_json::Value>(&bytes)\n        .ok()?\n        .get(\"schema_version\")?\n        .as_u64()\n}","typeGuard":null,"tryCatchPattern":"Match the 'unsupported Dream Skin backup schema' message, read schema_version from the backup JSON, and tell the user whether their app is older or newer than the backup; offer deleting the backup as the reset path.","preventionTips":["Do not downgrade apps across backup-format changes","Record the app version alongside state-dir snapshots"],"tags":["dream-skin","backup","schema-version","rust"],"backgroundTag":"unsupported-schema-version","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"}