From bd266bc3baab90393de40531fb140e7bcbea0ebc Mon Sep 17 00:00:00 2001 From: Raunak Burrows Date: Tue, 17 Nov 2026 06:32:36 +0000 Subject: [PATCH] fix: save a cleared variable value instead of keeping the old one (#12466) Updating a variable sent no value whenever the field was empty, so clearing a non-secret value (or a loaded secret) and clicking Update reported success but kept the stored value. Only skip the value when the baseline is empty too, which is the case of a secret never loaded. --- frontend/src/lib/components/VariableEditor.svelte | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/VariableEditor.svelte b/frontend/src/lib/components/VariableEditor.svelte index 6095419f6c..765f3be565 100644 --- a/frontend/src/lib/components/VariableEditor.svelte +++ b/frontend/src/lib/components/VariableEditor.svelte @@ -458,13 +458,10 @@ path: ini.path, requestBody: { path: ini.path != s.path ? s.path : undefined, - // An empty value keeps the stored one, except when it replaces a - // reference: the reference is then dropped for the empty value. + // An empty value keeps the stored one only while the baseline is empty too + // (a secret never loaded): clearing a value or reference that was shown saves it empty. value: - s.variable.value == '' && - !(isExternalRef(ini.variable.value) && !isExternalRef(s.variable.value)) - ? undefined - : s.variable.value, + s.variable.value == '' && ini.variable.value == '' ? undefined : s.variable.value, is_secret: ini.variable.is_secret != s.variable.is_secret ? s.variable.is_secret : undefined, description: