From df2973ffff679549b8ece1652417f29827e5da45 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 15 Sep 2026 22:55:35 +0200 Subject: [PATCH] fix: an unread head confirms with the copy for caution, not for an observed deploy Co-Authored-By: Claude Opus 5 (1M context) --- .../lib/components/apps/editor/AppEditorHeader.svelte | 10 ++++++++-- .../lib/components/raw_apps/RawAppEditorHeader.svelte | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte index 666aa9926a..9d6c1da834 100644 --- a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte @@ -474,6 +474,9 @@ * beside it or the anchor read failed. Either way this editor has no base to compare, * so the guard confirms. Set by `updateApp`. */ let baseUnknown = $state(false) + /** The last comparison could not read the head, so the confirmation it raises is + * caution and not an observed deploy. Cleared by the next reading comparison. */ + let headUnknown = $state(false) async function compareVersions() { if (baseUnknown) { // Nothing to compare against, so confirm rather than let the next deploy @@ -495,11 +498,14 @@ path: $appPath }) onLatest = appVersion?.version === undefined || base === appVersion?.version + headUnknown = false } catch (e) { console.error('Error comparing versions', e) // The head is what this compares against, so an unanswered read is not - // evidence of being current: confirm, as an unclaimable deploy does. + // evidence of being current: confirm, as an unclaimable deploy does, and say + // that is why rather than claiming a version that was never seen. onLatest = false + headUnknown = true } } @@ -784,7 +790,7 @@ bind:open {diffDrawer} claimOpening={() => (lastOpening = diffDrawer?.beginOpening())} - {baseUnknown} + baseUnknown={baseUnknown || headUnknown} bind:deployedValue currentValue={{ summary: $summary, diff --git a/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte b/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte index 3a660199f0..12924a97de 100644 --- a/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte +++ b/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte @@ -620,6 +620,9 @@ * beside it or the anchor read failed. Either way this editor has no base to compare, * so the guard confirms. Set by `updateApp`. */ let baseUnknown = $state(false) + /** The last comparison could not read the head, so the confirmation it raises is + * caution and not an observed deploy. Cleared by the next reading comparison. */ + let headUnknown = $state(false) async function compareVersions() { if (baseUnknown) { // Nothing to compare against, so confirm rather than let the next deploy @@ -636,11 +639,14 @@ path: appPath }) onLatest = appVersion?.version === undefined || version === appVersion?.version + headUnknown = false } catch (e) { console.error('Error comparing versions', e) // The head is what this compares against, so an unanswered read is not - // evidence of being current: confirm, as an unclaimable deploy does. + // evidence of being current: confirm, as an unclaimable deploy does, and say + // that is why rather than claiming a version that was never seen. onLatest = false + headUnknown = true } } @@ -734,7 +740,7 @@ bind:open {diffDrawer} claimOpening={() => (lastOpening = diffDrawer?.beginOpening())} - {baseUnknown} + baseUnknown={baseUnknown || headUnknown} bind:deployedValue currentValue={currentDiffValue} />