diff --git a/dressup-generate.test.js b/dressup-generate.test.js index 26a2cb1..b429dff 100644 --- a/dressup-generate.test.js +++ b/dressup-generate.test.js @@ -187,6 +187,12 @@ test("generate: full happy path lands a clip with character/garment/dance-ref tr assert.equal(clip.garmentId, garment.id); assert.equal(clip.refDanceVideoId, danceRef.id); assert.equal(clip.channel, "dance"); + // ingest.js's syncLibrary() only carries a library entry forward as-is + // when `edited` is true; otherwise its periodic auto-sync (every 5 min, + // server.js) rebuilds the record from the raw H3 job and silently drops + // channel/characterId/garmentId/refDanceVideoId — breaking both the M.7 + // dedupe cache and pickNextClip()'s dance-channel exclusion. + assert.equal(clip.edited, true, "dance clip must be edited:true or the next library sync wipes its traceability fields"); // T10's admin.html traceability column joins clip.characterId/garmentId/ // refDanceVideoId back against the three admin lists to show "谁的脸 + diff --git a/server.js b/server.js index 96ac41f..fea8b34 100644 --- a/server.js +++ b/server.js @@ -779,6 +779,13 @@ async function generateDanceVideo(job, opts = {}) { const clip = { id: polled.id, source: "h3console", + // ingest.js's syncLibrary() only carries an entry forward as-is + // when `edited` is true — otherwise it rebuilds the record from + // the raw H3 job on its next periodic sync, which knows nothing + // about channel/characterId/garmentId/refDanceVideoId and would + // silently strip them (and leak this clip into the non-dance + // pickNextClip() pool, since `channel` would be gone too). + edited: true, channel: "dance", characterId: job.characterId, garmentId: job.garmentId,