From 5cc4dcb29cf69a69b863fc5a22d7647a1178e444 Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:30:31 +0200 Subject: [PATCH] fix(frontend): drop extra_args when the variable expiration handler is cleared Clearing the handler nulls the whole setting server-side, extra_args included, but the tab kept its loaded copy. A handler picked afterwards without reloading was persisted with the cleared one's arguments, which the tab does not display. Co-Authored-By: Claude Opus 5 (1M context) --- .../(root)/(logged)/workspace_settings/+page.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte index d960019bbd..27696443ce 100644 --- a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte @@ -189,7 +189,8 @@ let variableExpirationItemKind: 'flow' | 'script' = $state('script') let variableExpirationMutedOnUserPath: boolean = $state(false) // Carried through saves rather than edited: `extra_args` is an API/CLI-only escape hatch - // for passing fixed arguments to the handler, and omitting it here would erase it. + // for passing fixed arguments to the handler, and omitting it on a save that keeps the + // handler would erase it. Only a save that clears the handler drops it. let variableExpirationExtraArgs: Record | undefined = $state(undefined) let criticalAlertUIMuted: boolean | undefined = $state(undefined) let initialCriticalAlertUIMuted: boolean | undefined = $state(undefined) @@ -923,6 +924,13 @@ async function editVariableExpirationHandler() { const path = variableExpirationFullPath(variableExpirationItemKind, variableExpirationPath) + // Saving with no path clears the whole setting server-side, `extra_args` included, so + // the loaded copy has to go too: a handler picked afterwards without reloading the page + // would otherwise be persisted with the cleared one's arguments, which this tab does + // not display. + if (!path) { + variableExpirationExtraArgs = undefined + } await WorkspaceService.editVariableExpirationHandler({ workspace: $workspaceStore!, requestBody: {