From 7b0e33f0a20dfb6fd6e183a64c13135ee3a67837 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 5 Jun 2025 18:05:31 +0200 Subject: [PATCH] fix(gui-client): allow legacy settings to parse new format (#9418) As part of the introduction of General settings, we split up "Advanced settings" and also renamed one of the fields. Upon first start, the settings are migrated to the new format. What we failed to notice is that one the next subsequent start, the legacy settings struct will fail to parse the now migrated configuration and fall back to the default. This then appears as if the settings are not getting saved. Resolves: #9417 --------- Co-authored-by: Jamil Bou Kheir --- rust/gui-client/src-tauri/src/settings.rs | 10 ++++++++++ website/src/components/Changelog/GUI.tsx | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/rust/gui-client/src-tauri/src/settings.rs b/rust/gui-client/src-tauri/src/settings.rs index f48b013c0..bf97cc18e 100644 --- a/rust/gui-client/src-tauri/src/settings.rs +++ b/rust/gui-client/src-tauri/src/settings.rs @@ -42,6 +42,7 @@ pub struct MdmSettings { #[derive(Clone, Deserialize, Serialize)] pub struct AdvancedSettingsLegacy { + #[serde(alias = "auth_url")] pub auth_base_url: Url, pub api_url: Url, #[serde(default)] @@ -304,4 +305,13 @@ mod tests { assert_eq!(actual.api_url.to_string(), "wss://example.com/"); assert_eq!(actual.log_filter, "info"); } + + #[test] + fn legacy_settings_can_parse_new_config() { + let advanced_settings = AdvancedSettings::default(); + + let new_format = serde_json::to_string(&advanced_settings).unwrap(); + + serde_json::from_str::(&new_format).unwrap(); + } } diff --git a/website/src/components/Changelog/GUI.tsx b/website/src/components/Changelog/GUI.tsx index caf40a46f..37990bad5 100644 --- a/website/src/components/Changelog/GUI.tsx +++ b/website/src/components/Changelog/GUI.tsx @@ -10,7 +10,12 @@ export default function GUI({ os }: { os: OS }) { return ( {/* When you cut a release, remove any solved issues from the "known issues" lists over in `client-apps`. This must not be done when the issue's PR merges. */} - + + + Fixes an issue where advanced settings were not saved and loaded + properly across restarts of the Client. + + Uses the new IP stack setting for DNS resources, which allows DNS