From cf1106efcfff38e44a513fcbd202611848c2f3a4 Mon Sep 17 00:00:00 2001 From: Nico Ritschel Date: Tue, 13 Oct 2026 08:48:47 -0700 Subject: [PATCH] Publish fleet asset bodies before deployment pointers --- scripts/native-worker/fleet.test.ts | 14 +++++++++++++- scripts/native-worker/fleet.ts | 7 ++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/native-worker/fleet.test.ts b/scripts/native-worker/fleet.test.ts index c2b90e1..7b27ab9 100644 --- a/scripts/native-worker/fleet.test.ts +++ b/scripts/native-worker/fleet.test.ts @@ -227,8 +227,20 @@ test.skipIf(process.env.NATIVE_WORKER_FLEET !== "1")( await operator.start(); operator.serve({ port: operatorPort }); await operator.publishHost(); - for (const node of nodes) + const galleryBundle = await readFile( + resolve(import.meta.dir, "../../dist/cloudflare/assets/gallery.js"), + "utf8", + ); + for (const node of nodes) { expect((await fetch(`${node}/health`)).status, logs).toBe(200); + const gallery = await fetch(`${node}/`); + expect(gallery.status, logs).toBe(200); + expect(await gallery.text()).toContain('src="/gallery.js"'); + const bundle = await fetch(`${node}/gallery.js`); + expect(bundle.status, logs).toBe(200); + expect(bundle.headers.get("content-type")).toContain("javascript"); + expect(await bundle.text(), logs).toBe(galleryBundle); + } expect( (await store.json("deploy/current.json"))?.value .script_name, diff --git a/scripts/native-worker/fleet.ts b/scripts/native-worker/fleet.ts index 6c18c11..aec99d7 100644 --- a/scripts/native-worker/fleet.ts +++ b/scripts/native-worker/fleet.ts @@ -304,7 +304,12 @@ export class CelldFleetOperator { `${prefix}/deploy/current.json`, ); if (!pointer) throw new Error("celld candidate pointer is missing"); - const keys = await this.store.keys(`${prefix}/deploy/`); + // celld stores asset bodies outside deploy/. Copy them before the index + // and manifest so the published pointer only names complete deployments. + const keys = [ + ...(await this.store.keys(`${prefix}/deploy-blobs/`)), + ...(await this.store.keys(`${prefix}/deploy/`)), + ]; for (const key of keys) { const target = key.slice(prefix.length + 1); if (