From cfc3f292ad2fdc6067c558e42ef0754eca9469a9 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Tue, 14 Jul 2026 17:19:42 +0200 Subject: [PATCH] fix(apps): allow setting sandbox isolation and public access before first deploy (#10085) * fix(apps): allow enabling sandbox isolation before first deploy Co-Authored-By: Claude Opus 4.8 (1M context) * fix(apps): allow setting public access mode before first deploy Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) --- .../apps/editor/AppEditorHeaderDeploy.svelte | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/AppEditorHeaderDeploy.svelte b/frontend/src/lib/components/apps/editor/AppEditorHeaderDeploy.svelte index f31339df70..880c24810d 100644 --- a/frontend/src/lib/components/apps/editor/AppEditorHeaderDeploy.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditorHeaderDeploy.svelte @@ -299,7 +299,13 @@ checked={policy.sandbox == true} on:change={(e) => { policy.sandbox = e.detail || undefined - setPublishState(e.detail ? 'Sandbox isolation enabled' : 'Sandbox isolation disabled') + // A not-yet-deployed app has no row to PATCH — `setPublishState` (POST + // /apps/update) would 404. The flag rides along in the `policy` the first + // deploy sends (createApp), so here we only mutate it locally. Persist + // incrementally once the app exists. + if (savedApp && !newApp) { + setPublishState(e.detail ? 'Sandbox isolation enabled' : 'Sandbox isolation disabled') + } }} disabled={!savedApp} /> @@ -310,8 +316,8 @@ on every surface (public URL and in-workspace). Leave it off if the app needs full browser features (IndexedDB, third-party auth/SDKs, OAuth redirects). - {#if !savedApp} -
Save the app once to change this setting.
+ {#if newApp} +
Takes effect when you first deploy this app.
{/if} {#if policy.sandbox == true}
@@ -343,9 +349,14 @@ checked={policy.execution_mode == 'anonymous'} on:change={(e) => { policy.execution_mode = e.detail ? 'anonymous' : 'publisher' - setPublishState() + // Same as sandbox: a not-yet-deployed app has no row to PATCH, so + // `setPublishState` would 404. The mode is carried by the first + // deploy's policy; persist incrementally only once the app exists. + if (savedApp && !newApp) { + setPublishState() + } }} - disabled={!savedApp || newApp || (!canSetAnonymous && policy.execution_mode != 'anonymous')} + disabled={!savedApp || (!canSetAnonymous && policy.execution_mode != 'anonymous')} />
{#if !savedApp || newApp}