From df62aa88d48fa8ebafed5a2b43eb160f81aeaec6 Mon Sep 17 00:00:00 2001 From: glass beadian Date: Fri, 16 Oct 2026 11:21:08 +0000 Subject: [PATCH] fix: probe lane ffprobes the OPENED source, not the sealed frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit downloadSealed fetched raw bytes (getSealedObject) and handed ciphertext to ffprobe — every direct upload failed 'Invalid data found'. The lane now uses getObject, whose magic branch opens SPENC1 and SPENC2 alike. --- apps/media-worker/src/producer/runner.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/media-worker/src/producer/runner.ts b/apps/media-worker/src/producer/runner.ts index 1f86f43..ed72245 100644 --- a/apps/media-worker/src/producer/runner.ts +++ b/apps/media-worker/src/producer/runner.ts @@ -166,7 +166,7 @@ export class ProduceRunner { private async runProbe(job: ClaimedProduceJob): Promise { const directory = await mkdtemp(join(this.deps.scratchRoot, "probe-")); try { - const bytes = await this.downloadSealed(job.source.storageKey); + const bytes = await this.downloadSource(job.source.storageKey); const inputPath = join(directory, scratchAssetName(job.source.storageKey, "bin")); await writeFile(inputPath, bytes, { mode: 0o600 }); await this.deps.jobs.progress(job.jobId, 50); @@ -195,13 +195,13 @@ export class ProduceRunner { } /** - * Fetch the sealed source. getSealedObject is the raw read (the api's twin); - * getObject then picks the frame branch by magic, so both SPENC1 (api-sealed) - * and SPENC2 (browser-sealed direct upload) sources probe identically here. + * Fetch the source PLAINTEXT: getObject picks the frame branch by magic, so + * SPENC1 (api-sealed) and SPENC2 (browser-sealed direct upload) sources open + * identically before ffprobe. getSealedObject stays for CEK-header reads. */ - private async downloadSealed(storageKey: string): Promise { + private async downloadSource(storageKey: string): Promise { try { - return await withTimeout(this.deps.storage.getSealedObject(storageKey), this.downloadTimeoutMs, "download failed"); + return await withTimeout(this.deps.storage.getObject(storageKey), this.downloadTimeoutMs, "download failed"); } catch (error: unknown) { if (error instanceof Error && error.name === "download failed") throw error; throw produceError("download failed");