{"record":{"id":"724ba35d45eaea62","repo":"gitbutlerapp/gitbutler","slug":"unknown-app-suffix-value-expected-one-of-dev","errorCode":null,"errorMessage":"Unknown app suffix '{value}', expected one of: dev, nightly, release","messagePattern":"Unknown app suffix '(.+?)', expected one of: dev, nightly, release","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-path/src/lib.rs","lineNumber":348,"sourceCode":"    new_window: bool,\n) -> anyhow::Result<url::Url> {\n    let mut url = url::Url::parse(&format!(\"{scheme}://open\"))?;\n    url.query_pairs_mut()\n        .append_pair(\"path\", &possibly_project_dir.to_string_lossy())\n        .append_pair(\"t\", &timestamp.to_string())\n        .append_pair(\"new_window\", if new_window { \"1\" } else { \"0\" });\n    Ok(url)\n}\n\nimpl std::str::FromStr for AppChannel {\n    type Err = anyhow::Error;\n\n    fn from_str(value: &str) -> Result<Self, Self::Err> {\n        match value {\n            \"nightly\" => Ok(AppChannel::Nightly),\n            \"release\" | \"production\" | \"prod\" => Ok(AppChannel::Release),\n            \"dev\" | \"development\" => Ok(AppChannel::Dev),\n            _ => Err(anyhow::anyhow!(\n                \"Unknown app suffix '{value}', expected one of: dev, nightly, release\"\n            )),\n        }\n    }\n}\n\nfn clean_env_vars<'a, 'b>(\n    var_names: &'a [&'b str],\n) -> impl Iterator<Item = (&'b str, String)> + 'a {\n    var_names\n        .iter()\n        .filter_map(|name| env::var(name).map(|value| (*name, value)).ok())\n        .map(|(name, value)| {\n            (\n                name,\n                value\n                    .split(':')\n                    .filter(|path| !path.contains(\"appimage-run\") && !path.contains(\"/tmp/.mount\"))","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-path/src/lib.rs#L330-L366","documentation":"AppChannel::from_str parses an app channel name/suffix into the AppChannel enum. It throws this error when the input string is not one of the recognized channel values ('nightly', 'release'/'production'/'prod', 'dev'/'development'). It exists to fail fast on unrecognized app suffixes rather than silently defaulting to a channel.","triggerScenarios":"Calling AppChannel::from_str (or .parse::<AppChannel>()) with any string other than the accepted aliases, e.g. 'beta', 'stable', 'main', 'Dev ' with whitespace, or mixed case like 'Nightly'.","commonSituations":"Config files or CLI flags specifying a channel with a typo, an outdated channel name that was removed, or a value that uses different casing/spacing than expected.","solutions":["Use one of the accepted values: dev/development, nightly, or release/production/prod","Normalize the input (trim and lowercase) before parsing","Handle the parse failure with a fallback to a default channel, e.g. unwrap_or(AppChannel::Release)"],"exampleFix":"// before\nlet channel = value.parse::<AppChannel>()?; // value = \"Beta\"\n// after\nlet channel = value.trim().to_lowercase().parse::<AppChannel>().unwrap_or(AppChannel::Release);","handlingStrategy":"validation","validationCode":"fn is_valid_channel(v: &str) -> bool {\n    matches!(v.trim().to_lowercase().as_str(), \"dev\" | \"development\" | \"nightly\" | \"release\" | \"production\" | \"prod\")\n}","typeGuard":"fn valid_channel(s: &str) -> Option<AppChannel> {\n    AppChannel::from_str(&s.trim().to_lowercase()).ok()\n}","tryCatchPattern":"let channel = value.parse::<AppChannel>()\n    .map_err(|e| format!(\"invalid channel '{value}': {e}\"))?;","preventionTips":["Trim and lowercase channel strings before parsing","Keep channel names centralized in constants/enum parsing, never free-form strings","Fall back to a documented default channel and log a warning"],"tags":["parsing","enum","invalid-input"],"backgroundTag":"invalid-enum-value","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}