From 069d66627d485d2dc37b356ca54869445ba15fa0 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Sun, 6 Sep 2026 09:41:47 +0200 Subject: [PATCH] fix(schedules): let the create's enabled state reach the form only if nothing changed it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adopting it unconditionally overwrote whatever the field held by then, so a write landing during the request — the chat seeding the cell — was erased before anything could notice it had, and settled away as if it were the save's own. What was written still records `true`, since that is what the create sent; the form follows only while it still holds the value that went with it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KcyBRxE8j3ujCYkum9KrC4 --- .../triggers/schedules/ScheduleEditorInner.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte index 25fa955259..d396c5fcb7 100644 --- a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte +++ b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte @@ -626,11 +626,14 @@ const isSaved = await saveScheduleFromCfg(scheduleCfg, edit, wsId!) if (isSaved) { // A create deploys the schedule enabled whatever the form said (see - // saveScheduleFromCfg), so both the form and what counts as written adopt it - // — otherwise the baseline below records a state the server does not have. + // saveScheduleFromCfg), so what counts as written records that — otherwise + // the baseline below claims a state the server does not have. The form + // follows only while it still holds what was sent: changed during the + // request, it is a newer edit, and `keptEdit` below is what protects it. if (wasCreate) { - enabled = true + const sentEnabled = scheduleCfg.enabled scheduleCfg.enabled = true + if (enabled === sentEnabled) enabled = true } // What was sent is the deployed value now. Adopted here rather than by // remounting: the form stays editable during the write, and a remount would