From e62d532ddb9fbe4e4d437eb0557c9137c1f55ab4 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Mon, 21 Sep 2026 02:04:16 +0100 Subject: [PATCH 1/2] Keep verifyBuildId tolerant of unstamped runtimes The standalone packager only stamps a build id onto its scaffolding in production, so a strict check makes a development build refuse the runtime it just produced. Upstream tolerated an unstamped source for that reason; restore it. The editor stamps every runtime it emits, so nothing changes here. Co-Authored-By: Claude Opus 5 (1M context) --- src/packager/packager/build-id.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/packager/packager/build-id.js b/src/packager/packager/build-id.js index e9b5a79977d..0996ae95a4c 100644 --- a/src/packager/packager/build-id.js +++ b/src/packager/packager/build-id.js @@ -1,4 +1,10 @@ -// Set once by the GUI build and shared with every emitted packager runtime. +// Set once by the host build and shared with every emitted packager runtime. import {buildId} from 'virtual:packager-runtime'; -const verifyBuildId = (expectedBuildId, source) => source.endsWith(`${expectedBuildId} =^..^=`); + +// A runtime only carries a build id when the host stamped one on. Development +// builds of the standalone packager do not, and rejecting those would make it +// refuse the scaffolding it just built. +const verifyBuildId = (expectedBuildId, source) => (source.endsWith('=^..^=') ? + source.endsWith(`${expectedBuildId} =^..^=`) : true); + export {buildId, verifyBuildId}; From 6ab2af9ff71921f4bb376fe24b0591b3ccaccdd3 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Mon, 21 Sep 2026 03:21:26 +0100 Subject: [PATCH 2/2] Expect unstamped runtimes to pass verifyBuildId Co-Authored-By: Claude Opus 5 (1M context) --- test/unit/packager-export.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/packager-export.test.js b/test/unit/packager-export.test.js index e72865c1ac0..ac88d686fe6 100644 --- a/test/unit/packager-export.test.js +++ b/test/unit/packager-export.test.js @@ -40,8 +40,9 @@ test('cancelled project preparation cannot continue into packaging', async () => expect(downloadProject).not.toHaveBeenCalled(); }); -test('runtime validation rejects stale deployments and unversioned scripts', () => { +test('runtime validation rejects stale deployments and accepts unstamped runtimes', () => { expect(verifyBuildId('current', 'runtime code\n// current =^..^=')).toBe(true); expect(verifyBuildId('current', 'runtime code\n// previous =^..^=')).toBe(false); - expect(verifyBuildId('current', 'runtime code')).toBe(false); + // Development builds of the standalone packager do not stamp their runtimes. + expect(verifyBuildId('current', 'runtime code')).toBe(true); });