diff --git a/frontend/src/routes/(root)/(logged)/apps/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/apps/edit/[...path]/+page.svelte index 5f4813c75f..bb6989e65b 100644 --- a/frontend/src/routes/(root)/(logged)/apps/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/apps/edit/[...path]/+page.svelte @@ -239,6 +239,12 @@ } diffDrawer?.closeDrawer() UserDraft.remove('app', path) + // Force AppEditor to unmount so its UserDraft handle releases — + // otherwise loadApp's `UserDraft.get` would read the stale autosave + // from the still-alive in-memory entry and the staleness check + // would fire a spurious "newer version was deployed" modal. + app = undefined + redraw++ goto(`/apps/edit/${savedApp.draft.path}`) await loadApp() redraw++ @@ -258,6 +264,8 @@ }) } UserDraft.remove('app', path) + app = undefined + redraw++ goto(`/apps/edit/${savedApp.path}`) await loadApp() redraw++ diff --git a/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte index d8444f0197..a09776a0ee 100644 --- a/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte @@ -278,6 +278,11 @@ } diffDrawer?.closeDrawer() UserDraft.remove('raw_app', path) + // Drop the in-memory handle state so loadApp sees no local draft + // on the next pass — otherwise the staleness check would compare + // the stale in-memory meta against the freshly fetched backend and + // fire a spurious modal. + draftHandle.setDraftAndMeta(undefined, {}) goto(`/apps/edit/${savedApp.draft.path}`) await loadApp() redraw++ @@ -297,6 +302,7 @@ }) } UserDraft.remove('raw_app', path) + draftHandle.setDraftAndMeta(undefined, {}) goto(`/apps/edit/${savedApp.path}`) await loadApp() redraw++ diff --git a/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte index b0042e2ebd..a52f3edd95 100644 --- a/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte @@ -304,6 +304,11 @@ } diffDrawer?.closeDrawer() UserDraft.remove('flow', flowDraftPath) + // Drop the in-memory handle state so loadFlow sees no local draft + // on the next pass — otherwise the staleness check would compare + // the stale in-memory meta against the freshly fetched backend and + // fire a spurious modal. + flowHandle.setDraftAndMeta(undefined, {}) goto(`/flows/edit/${savedFlow.draft.path}`) loadFlow() } @@ -322,6 +327,7 @@ }) } UserDraft.remove('flow', flowDraftPath) + flowHandle.setDraftAndMeta(undefined, {}) goto(`/flows/edit/${savedFlow.path}`) loadFlow() } diff --git a/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte index 0faec2326c..6f18a23e4f 100644 --- a/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte @@ -299,6 +299,11 @@ } diffDrawer?.closeDrawer() UserDraft.remove('script', draftPath) + // Drop the in-memory handle state so loadScript sees no local draft + // on the next pass — otherwise the staleness check would compare the + // stale in-memory meta against the freshly fetched backend and fire + // a spurious modal. + scriptHandle.setDraftAndMeta(undefined, {}) goto(`/scripts/edit/${savedScript.draft.path}`) loadScript() } @@ -317,6 +322,7 @@ }) } UserDraft.remove('script', draftPath) + scriptHandle.setDraftAndMeta(undefined, {}) goto(`/scripts/edit/${savedScript.path}`) loadScript() }