From 56d7479a3500609bcb6370ed560f64646a4ced17 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 28 May 2026 14:24:04 -0400 Subject: [PATCH] fix(mam-api): pass project_id into conform job so render can register the asset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The conform worker's final step INSERTs the rendered output into the assets table: INSERT INTO assets (project_id, filename, display_name, …) VALUES ($1, …) -- project_id NOT NULL It reads projectId from job.data, but the /sequences/:id/conform endpoint never set it. Render finished cleanly, ffmpeg ran, output uploaded to S3, then the final asset row INSERT failed: null value in column "project_id" of relation "assets" Pass seq.project_id from the loaded sequence row. The rendered output lands as an asset under the same project as its source sequence — the natural target. Co-Authored-By: Claude Opus 4.7 --- services/mam-api/src/routes/sequences.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/mam-api/src/routes/sequences.js b/services/mam-api/src/routes/sequences.js index f806159..b7dd20c 100644 --- a/services/mam-api/src/routes/sequences.js +++ b/services/mam-api/src/routes/sequences.js @@ -315,6 +315,12 @@ router.post('/:id/conform', async (req, res, next) => { const bullJob = await conformQueue.add('conform-task', { fcpXml: fcp_xml, sequenceId: req.params.id, + // The worker INSERTs the rendered output into the `assets` table at the + // end of the pipeline; project_id is NOT NULL on that table, so without + // this the conform finished successfully but failed at the very last + // step. Sequences live under projects, so the natural target for the + // rendered output is the sequence's own project. + projectId: seq.project_id, sequenceName: seq.name, frameRate: seq.frame_rate, width: seq.width,