{"record":{"id":"ef86bf0b3b7a60c5","repo":"flxzt/rnote","slug":"store-snapshot-has-no-value-stroke-components","errorCode":null,"errorMessage":"store snapshot has no value `stroke_components`.","messagePattern":"store snapshot has no value `stroke_components`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/rnoteformat/maj0min6.rs","lineNumber":29,"sourceCode":"}\n\nimpl TryFrom<RnoteFileMaj0Min5Patch9> for RnoteFileMaj0Min6 {\n    type Error = anyhow::Error;\n\n    fn try_from(mut value: RnoteFileMaj0Min5Patch9) -> Result<Self, Self::Error> {\n        let mut engine_snapshot = ijson::IObject::new();\n\n        let store_snapshot = value\n            .store_snapshot\n            .as_object_mut()\n            .ok_or_else(|| anyhow!(\"store snapshot is not a JSON object.\"))?;\n\n        engine_snapshot.insert(String::from(\"document\"), value.document);\n        engine_snapshot.insert(\n            String::from(\"stroke_components\"),\n            store_snapshot\n                .remove(\"stroke_components\")\n                .ok_or_else(|| anyhow!(\"store snapshot has no value `stroke_components`.\"))?,\n        );\n        engine_snapshot.insert(\n            String::from(\"chrono_components\"),\n            store_snapshot\n                .remove(\"chrono_components\")\n                .ok_or_else(|| anyhow!(\"store snapshot has no value `chrono_components`.\"))?,\n        );\n        engine_snapshot.insert(\n            String::from(\"chrono_counter\"),\n            store_snapshot\n                .remove(\"chrono_counter\")\n                .ok_or_else(|| anyhow!(\"store snapshot has no value `chrono_counter`.\"))?,\n        );\n\n        Ok(Self {\n            engine_snapshot: engine_snapshot.into(),\n        })\n    }","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/rnoteformat/maj0min6.rs#L11-L47","documentation":"The maj0min5patch9 -> maj0min6 migration requires `store_snapshot.stroke_components` to exist, since it becomes the top-level `engine_snapshot.stroke_components` in the new format. This error is thrown when the store snapshot object does not contain a `stroke_components` key.","triggerScenarios":"Running `RnoteFileMaj0Min6::try_from` on a file whose store snapshot object lacks `stroke_components` after the `remove()` call.","commonSituations":"Files written by an older rnote build that predates stroke_components, hand-edited files with the key removed, or corruption during save.","solutions":["Inspect the extracted file JSON and add a `stroke_components` array (possibly empty) to the store snapshot.","Restore the document from a backup or autosave.","Open the file with the rnote version matching the stored format version and re-save it.","If the key is genuinely obsolete in your file lineage, pre-migrate by inserting an empty `stroke_components` array before conversion."],"exampleFix":"// before\n\"store_snapshot\": { \"chrono_components\": [] }\n// after\n\"store_snapshot\": { \"stroke_components\": [], \"chrono_components\": [] }","handlingStrategy":"validation","validationCode":"// validate before migration\nfn has_stroke_components(doc: &serde_json::Value) -> bool {\n    doc[\"store_snapshot\"].get(\"stroke_components\").map_or(false, |v| v.is_array())\n}","typeGuard":"fn store_snapshot_has(doc: &serde_json::Value, key: &str) -> bool {\n    doc[\"store_snapshot\"].get(key).is_some()\n}","tryCatchPattern":"match RnoteFileMaj0Min6::try_from(prev) {\n    Ok(migrated) => /* use migrated */,\n    Err(e) if e.to_string().contains(\"no value `stroke_components`\") => {\n        // insert an empty stroke_components array and retry\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Ensure store snapshots always carry `stroke_components`, even if empty.","Validate required store snapshot keys before migration.","Keep backups/autosaves of .rnote files.","Migrate through the rnote app rather than hand-editing file JSON."],"tags":["file-format","json","migration","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}