{"record":{"id":"ed244fe3ced1b93b","repo":"flxzt/rnote","slug":"affine-does-not-have-value-at-index-7","errorCode":null,"errorMessage":"affine does not have value at index 7","messagePattern":"affine does not have value at index 7","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/rnoteformat/maj0min15.rs","lineNumber":160,"sourceCode":"                .get(1)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 1\"))?,\n            affine\n                .get(3)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 3\"))?,\n            affine\n                .get(4)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 4\"))?,\n            affine\n                .get(6)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 6\"))?,\n            affine\n                .get(7)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 7\"))?,\n        ],\n    );\n\n    Ok(())\n}\n","sourceCodeStart":142,"sourceCodeEnd":166,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/rnoteformat/maj0min15.rs#L142-L166","documentation":"The \"affine\" array is missing element at index 7 (the final element of the stored matrix). This is the last lookup in convert_transform_to_affine_in_obj, so the array had the previous elements but stopped short of the full 8.","triggerScenarios":"An .rnote file with an \"affine\" array of length 7 (indexes 0-6 present, 7 missing) during the maj0min15 conversion.","commonSituations":"Off-by-one in a custom exporter (writing 7 of 8 values) or truncated JSON.","solutions":["Append the missing 8th element so \"affine\" is a complete [a,b,c,d,e,f,g,h] matrix.","Restore from backup or re-export the document.","Fix the exporter to emit exactly 8 matrix values (use a fixed-size array type so the compiler enforces it)."],"exampleFix":"// before\n\"affine\": [1, 0, 0, 1, 10, 20, 0]\n// after\n\"affine\": [1, 0, 0, 1, 10, 20, 0, 1]","handlingStrategy":"validation","validationCode":"assert_eq!(affine.len(), 8, \"affine must have exactly the 8 stored matrix values\");","typeGuard":"fn is_full_affine(a: &serde_json::Value) -> bool {\n    a.as_array().map(|a| a.len() >= 8).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Use [f64; 8] (not Vec) in writers so the element count is compile-time enforced.","Watch for off-by-one when flattening 3x3 matrices; the last row is implicit.","Validate files at import time before migrations run."],"tags":["json","file-migration","index-out-of-range"],"backgroundTag":"index-out-of-bounds","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}