{"record":{"id":"2864425cba9b518e","repo":"zellij-org/zellij","slug":"invalid-resizetype","errorCode":null,"errorMessage":"Invalid ResizeType: {}","messagePattern":"Invalid ResizeType: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"zellij-utils/src/ipc/protobuf_conversion.rs","lineNumber":3486,"sourceCode":"}\n\nfn unblock_condition_to_proto_i32(condition: crate::data::UnblockCondition) -> i32 {\n    use crate::client_server_contract::client_server_contract::UnblockCondition as ProtoUnblockCondition;\n    match condition {\n        crate::data::UnblockCondition::OnExitSuccess => ProtoUnblockCondition::OnExitSuccess as i32,\n        crate::data::UnblockCondition::OnExitFailure => ProtoUnblockCondition::OnExitFailure as i32,\n        crate::data::UnblockCondition::OnAnyExit => ProtoUnblockCondition::OnAnyExit as i32,\n    }\n}\n\n// Reverse helper functions for Action conversion\n\nfn proto_i32_to_resize(resize: i32) -> Result<crate::data::Resize> {\n    use crate::client_server_contract::client_server_contract::ResizeType as ProtoResize;\n    let proto_resize = match resize {\n        x if x == ProtoResize::Increase as i32 => ProtoResize::Increase,\n        x if x == ProtoResize::Decrease as i32 => ProtoResize::Decrease,\n        _ => return Err(anyhow!(\"Invalid ResizeType: {}\", resize)),\n    };\n    match proto_resize {\n        ProtoResize::Increase => Ok(crate::data::Resize::Increase),\n        ProtoResize::Decrease => Ok(crate::data::Resize::Decrease),\n        ProtoResize::Unspecified => Err(anyhow!(\"Unspecified ResizeType\")),\n    }\n}\n\nfn proto_i32_to_direction(direction: i32) -> Result<crate::data::Direction> {\n    use crate::client_server_contract::client_server_contract::Direction as ProtoDirection;\n    let proto_direction = match direction {\n        x if x == ProtoDirection::Left as i32 => ProtoDirection::Left,\n        x if x == ProtoDirection::Right as i32 => ProtoDirection::Right,\n        x if x == ProtoDirection::Up as i32 => ProtoDirection::Up,\n        x if x == ProtoDirection::Down as i32 => ProtoDirection::Down,\n        _ => return Err(anyhow!(\"Invalid Direction: {}\", direction)),\n    };\n    match proto_direction {","sourceCodeStart":3468,"sourceCodeEnd":3504,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-utils/src/ipc/protobuf_conversion.rs#L3468-L3504","documentation":"Returned by the reverse-conversion helper proto_i32_to_resize when the incoming i32 matches neither ResizeType::Increase nor ResizeType::Decrease. Note that Unspecified (=0) is also caught here, so this error fires both for garbage values and for unset fields.","triggerScenarios":"Converting an Action's resize field where the sender left the proto enum unset (proto3 default 0 = Unspecified) or sent an out-of-range integer, e.g. a Resize action decoded from a mismatched or malformed protobuf message.","commonSituations":"Version skew between client and server after the resize enum changed; payloads built by external tooling that omits the resize field entirely.","solutions":["Ensure the sender always sets resize explicitly when serializing a Resize action","Use matching zellij versions on both ends of the IPC connection","Validate the i32 is one of Increase/Decrease before invoking the conversion"],"exampleFix":"// before\nlet resize = proto_i32_to_resize(action.resize)?;\n\n// after\nlet resize = proto_i32_to_resize(action.resize)\n    .unwrap_or(crate::data::Resize::Increase); // or surface a typed error upstream","handlingStrategy":"validation","validationCode":"use crate::client_server_contract::client_server_contract::ResizeType as ProtoResize;\nfn resize_value_is_valid(v: i32) -> bool {\n    v == ProtoResize::Increase as i32 || v == ProtoResize::Decrease as i32\n}","typeGuard":"fn is_valid_resize(v: i32) -> bool {\n    v == ProtoResize::Increase as i32 || v == ProtoResize::Decrease as i32\n}","tryCatchPattern":"let resize = proto_i32_to_resize(action.resize)\n    .map_err(|e| e.context(\"action.resize missing or out of range — sender likely omitted the field\"))?;","preventionTips":["Always set enum fields on the sender, even when a default seems obvious","Keep both ends of the IPC on one build; deploy client and server together","Treat value 0 in logs as 'field never set' and fix the producer, not the consumer"],"tags":["protobuf","ipc","resize","enum-decode"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}