From 0cbfc8336649f1296b77e4f30fcc04d21936db34 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Thu, 1 Oct 2026 11:45:26 +0200 Subject: [PATCH] fix: retry the leftover draft save with what failed, never an empty draft Co-Authored-By: Claude Opus 5.5 (1M context) --- .../lib/components/sessions/PipelineEditorView.svelte | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/components/sessions/PipelineEditorView.svelte b/frontend/src/lib/components/sessions/PipelineEditorView.svelte index aabb211b67..6cca4ce2e0 100644 --- a/frontend/src/lib/components/sessions/PipelineEditorView.svelte +++ b/frontend/src/lib/components/sessions/PipelineEditorView.svelte @@ -378,8 +378,8 @@ // Saves what is left of the folder's draft and says why if that failed. A // flush resolves even when the save failed, and the server would then keep // drafts already deployed — deploying them again would recreate their - // triggers. After a failed save there may be nothing queued to flush, so an - // emptied draft is sent again. + // triggers. A failed save stays queued until one succeeds, so the flush + // retries exactly what failed, an open script's unsaved edits included. async function saveRemaining(): Promise { await tick() const draft = { @@ -387,11 +387,7 @@ itemKind: PIPELINE_DRAFT_KIND, path: pipelineBundlePath(path) } - if (pendingCount === 0 && UserDraftDbSyncer.getState(draft).state === 'failed') { - await UserDraftDbSyncer.save({ ...draft, value: null, immediate: true }) - } else { - await UserDraftDbSyncer.flush(draft) - } + await UserDraftDbSyncer.flush(draft) if (UserDraftDbSyncer.getConflict(draft).conflict) return 'the remaining drafts conflict with a newer version.' const sync = UserDraftDbSyncer.getState(draft)