From 7dbd5f8f56393ce720ed6751234a107e3bd84c0f Mon Sep 17 00:00:00 2001 From: riccardom Date: Wed, 2 Sep 2026 14:35:45 +0200 Subject: [PATCH] [client] Drop an unreachable guard and fix two stale comments - loginOverridesInput's nil-message guard cannot be reached: Login dereferences the message well before it, in storedLoginConfig. - The docstring above afterLoginPreCheck described persistLoginOverrides, which lives further down the file and now carries its own. - UpdateConfig's comment named DirectUpdateConfig; the function is DirectUpdateOrCreateConfig. --- client/internal/profilemanager/config.go | 4 ++-- client/server/server.go | 2 -- client/server/update_settings_gate.go | 4 ---- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/client/internal/profilemanager/config.go b/client/internal/profilemanager/config.go index f690a1bd1..029eb14ec 100644 --- a/client/internal/profilemanager/config.go +++ b/client/internal/profilemanager/config.go @@ -1059,8 +1059,8 @@ func UpdateConfig(input ConfigInput) (*Config, error) { // A UI that round-trips the mask GetConfig hands it back is asking to keep // the stored key, not to set the mask as the new one. UpdateOrCreateConfig - // and DirectUpdateConfig already collapse it; this one did not, so the - // same round-trip through SetConfig replaced the key with asterisks. + // and DirectUpdateOrCreateConfig already collapse it; this one did not, so + // the same round-trip through SetConfig replaced the key with asterisks. if isPreSharedKeyHidden(input.PreSharedKey) { input.PreSharedKey = nil } diff --git a/client/server/server.go b/client/server/server.go index de6870ff2..09d47d91f 100644 --- a/client/server/server.go +++ b/client/server/server.go @@ -2602,8 +2602,6 @@ func sendTerminalNotification() error { return wallCmd.Wait() } -// persistLoginOverrides writes management URL and pre-shared key from a LoginRequest to the -// active profile config so that subsequent reads pick them up. Empty/nil values are ignored. // afterLoginPreCheck is a seam for tests to run a concurrent config change // between Login's first privilege check and the authoritative one. var afterLoginPreCheck func() diff --git a/client/server/update_settings_gate.go b/client/server/update_settings_gate.go index fc42ba86a..b4d32754f 100644 --- a/client/server/update_settings_gate.go +++ b/client/server/update_settings_gate.go @@ -43,10 +43,6 @@ func configChangeRequested(stored *profilemanager.Config, input profilemanager.C // through this builder, so the gate can neither refuse a field the write // ignores nor miss one it applies. func loginOverridesInput(msg *proto.LoginRequest) profilemanager.ConfigInput { - if msg == nil { - return profilemanager.ConfigInput{} - } - preSharedKey := msg.OptionalPreSharedKey if preSharedKey != nil && *preSharedKey == "" { preSharedKey = nil