{"record":{"id":"88282401223b9243","repo":"GitoxideLabs/gitoxide","slug":"an-undo-reference-state-has-an-unknown-encoding","errorCode":null,"errorMessage":"an undo reference state has an unknown encoding","messagePattern":"an undo reference state has an unknown encoding","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/undo.rs","lineNumber":666,"sourceCode":"\nfn parse_state(repo: &gix::Repository, value: &BStr) -> Result<State> {\n    if value == b\"missing\" {\n        return Ok(State::Missing);\n    }\n    if let Some(hex) = value.strip_prefix(b\"object:\") {\n        let id = ObjectId::from_hex(hex).context(\"an undo object ID is invalid\")?;\n        ensure!(\n            id.kind() == repo.object_hash(),\n            \"an undo object ID uses the wrong hash kind\"\n        );\n        return Ok(State::Object(id));\n    }\n    if let Some(name) = value.strip_prefix(b\"symbolic:\") {\n        return FullName::try_from(name.as_bstr())\n            .map(State::Symbolic)\n            .context(\"an undo symbolic target is invalid\");\n    }\n    bail!(\"an undo reference state has an unknown encoding\")\n}\n\nfn validate_title(title: &str) -> Result<()> {\n    ensure!(!title.is_empty(), \"an undo operation title cannot be empty\");\n    ensure!(\n        !title.as_bytes().iter().any(|byte| matches!(byte, b'\\n' | b'\\r')),\n        \"an undo operation title must be one line\"\n    );\n    Ok(())\n}\n\nfn retention_parents(repo: &gix::Repository, predecessor: ObjectId, changes: &[RefChange]) -> Result<Vec<ObjectId>> {\n    let mut parents = vec![predecessor];\n    let mut seen = HashSet::from([predecessor]);\n    for id in changes\n        .iter()\n        .flat_map(|change| [&change.before, &change.after])\n        .filter_map(|state| match state {","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/undo.rs#L648-L684","documentation":"Decoder guard in `edit::undo::parse_state`, called from `parse_config` when reading persisted undo-queue state strings. Recognized encodings are `missing`, `object:<hex>` (with a hash-kind check), and `symbolic:<name>`; any other string stored in the undo configuration has an unknown encoding and bails. This fires on corrupted or hand-edited undo queue config data, or state written by a newer/different tool version. Fix by correcting or resetting the undo queue configuration (removing the malformed entries) rather than editing it by hand.","triggerScenarios":"Thrown at gix-tix/src/edit/undo.rs:666 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw undo-queue config value and correct it to one of the supported encodings: \"missing\", \"object:<hex-id>\", or \"symbolic:<full-name>\"","Drop the corrupt undo queue reference and let tix rebuild it from fresh edits","Upgrade/downgrade tix consistently so queue entries are written and read by the same encoding version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}