From 2c702efec026bebdd9c1b8cdca4808e394b2fd09 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 14 Jul 2026 19:02:22 +0200 Subject: [PATCH] fix(frontend): stop spurious raw-app reload that 404s on "Start without AI" (#10099) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): stop spurious raw-app reload that 404s on "Start without AI" Creating a new raw app and clicking "Start without AI" surfaced an "App not found" toast. The page's load effect re-ran loadApp() mid-bootstrap and fetched the draft via getAppByPath before the first autosave POST had landed → 404. Root cause: the effect used the legacy run() from svelte/legacy without untrack, so loadApp()'s synchronous reactive read of the draft-hint SvelteMap (getLocalDraftHint via shouldSeedNewDraft, added in #10044) subscribed the effect. The first autosave optimistically flips that hint (#9351) before its debounced POST, re-firing the effect → spurious loadApp() → getAppByPath on a not-yet-persisted draft. Convert the block to $effect + untrack so it depends only on page.params.path / $workspaceStore, matching the sibling apps/edit and flows/edit routes. Autosave and draft persistence are unchanged; only the phantom reload is removed. Co-Authored-By: Claude Opus 4.8 (1M context) * chore(frontend): tighten untrack invariant comment to ≤4 lines Per AGENTS.md comment policy (Codex review nit). Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) --- .../apps_raw/edit/[...path]/+page.svelte | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 99d9137783..704f4a99eb 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 @@ -1,6 +1,5 @@