From 01c45104fd569d609ede9b8357060a6fcaa16ef3 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Fri, 16 Oct 2026 12:55:26 +0200 Subject: [PATCH] fix: keep the resource AppConnect fills when linking its account fails Deleting a variable also deletes the resource at its path, so the rollback is skipped when filling an existing resource. Co-Authored-By: Claude Opus 5.5 --- frontend/src/lib/components/AppConnectInner.svelte | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/AppConnectInner.svelte b/frontend/src/lib/components/AppConnectInner.svelte index 18ab67a120..279165ffbd 100644 --- a/frontend/src/lib/components/AppConnectInner.svelte +++ b/frontend/src/lib/components/AppConnectInner.svelte @@ -1011,11 +1011,14 @@ requestBody: { ...accountData, variable_path: tokenPath } }) } catch (e) { - // An unlinked token never refreshes, and its path would block a retry. - await VariableService.deleteVariable({ - workspace: effectiveWorkspace, - path: tokenPath - }).catch(() => {}) + // An unlinked token never refreshes, and its path would block a retry. Not when + // filling: deleting a variable also deletes the resource at its path. + if (!filling) { + await VariableService.deleteVariable({ + workspace: effectiveWorkspace, + path: tokenPath + }).catch(() => {}) + } throw e } }