From 0feeb2a627a16e577f3f252d32e6625457da9490 Mon Sep 17 00:00:00 2001 From: Levi van Noort <73097785+levivannoort@users.noreply.github.com> Date: Wed, 12 Aug 2026 12:28:58 +0200 Subject: [PATCH] fix(variables): drop the key from the draft map before writing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A rejected update left its key in vars, so the second pass picked it up as a new variable and resent the stored key — the exact call the sparse update is meant to avoid for keys that predate the identifier rule. --- .../project-[region]-[project]/rawVariableEditor.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[region]-[project]/rawVariableEditor.svelte b/src/routes/(console)/project-[region]-[project]/rawVariableEditor.svelte index 708734444..b1c3b79b2 100644 --- a/src/routes/(console)/project-[region]-[project]/rawVariableEditor.svelte +++ b/src/routes/(console)/project-[region]-[project]/rawVariableEditor.svelte @@ -152,6 +152,11 @@ editableVariables.map(async (variable) => { const newValue = vars[variable.key] ?? null; + // Claim the key up front. A rejected write must not leave it + // behind for the second pass, which would retry it as a new + // variable and send the stored key along with it. + delete vars[variable.key]; + if (newValue === null) { await sdkDeleteVariable(variable.$id); } else if (newValue !== variable.value) { @@ -159,7 +164,6 @@ // the API keep the stored one. await sdkUpdateVariable(variable.$id, undefined, newValue, false); } - delete vars[variable.key]; }) );