{"record":{"id":"072b3b5bed5257e9","repo":"atuinsh/atuin","slug":"failed-to-override-timezone-with-utc","errorCode":null,"errorMessage":"failed to override timezone with UTC","messagePattern":"failed to override timezone with UTC","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/atuin-client/src/settings.rs","lineNumber":1156,"sourceCode":"    pub tmux: Tmux,\n\n    #[serde(default)]\n    pub logs: Logs,\n\n    #[serde(default)]\n    pub meta: meta::Settings,\n\n    #[serde(default)]\n    pub ai: Ai,\n}\n\nimpl Settings {\n    #[must_use]\n    pub fn utc() -> Self {\n        Self::builder()\n            .expect(\"Could not build default\")\n            .set_override(\"timezone\", \"0\")\n            .expect(\"failed to override timezone with UTC\")\n            .build()\n            .expect(\"Could not build config\")\n            .try_deserialize()\n            .expect(\"Could not deserialize config\")\n    }\n\n    #[must_use]\n    pub fn search_mode(&self) -> SearchMode {\n        self.requested_search_mode.into()\n    }\n\n    pub fn search_mode_shell_up_key_binding(&self) -> Option<SearchMode> {\n        self.requested_search_mode_shell_up_key_binding.map(Into::into)\n    }\n\n    /// Return the active search mode depending on whether Atuin was invoked from the \"up\"\n    /// keybinding.\n    ///","sourceCodeStart":1138,"sourceCodeEnd":1174,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin-client/src/settings.rs#L1138-L1174","documentation":"`Settings::utc()` builds default settings and overrides the `timezone` key to \"0\" (UTC). The `.expect(\"failed to override timezone with UTC\")` panics if `config::Config::set_override` returns an error. This is an internal invariant: the override of a known string key with a plain string value should never fail, so a panic here indicates the config builder itself is broken.","triggerScenarios":"Calling `Settings::utc()` when the config builder produced a Config whose source does not accept overrides (e.g. frozen config, or the `timezone` key collides with a non-overridable typed value in a misconfigured build).","commonSituations":"Effectively never in normal use — this is defensive code; it can only fire if the `config` crate semantics change or the builder chain is modified so set_override receives an invalid key path.","solutions":["Verify the `config` crate version has not changed `set_override` semantics (update/lock the dependency).","Check that the `timezone` field in Settings still exists and accepts string overrides; update the key if the field was renamed.","If you hit this in a fork, compare your builder chain against upstream `Settings::builder()` for changes.","Report upstream — panic messages in `utc()` are internal invariant violations."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// utc() panics via expect; it cannot be caught with Result handling.\n// Guard by calling it only with stock atuin-client + config crate versions,\n// or wrap in catch_unwind if you must isolate it:\nlet settings = std::panic::catch_unwind(Settings::utc)\n    .unwrap_or_else(|_| Settings::builder().expect(\"default\").build().expect(\"config\").try_deserialize().expect(\"settings\"));","preventionTips":["Keep atuin-client and the `config` crate versions aligned with upstream lockfiles.","Treat panics in Settings::utc()/Default as upstream regressions and report them.","Don't modify the timezone override key without checking the Settings field type."],"tags":["config","panic","internal-invariant"],"backgroundTag":"invalid-config-value","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}