From a0e7d336e92fb75fb47ca17624b8d8965c9cf508 Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Mon, 29 Jun 2026 18:56:33 -0700 Subject: [PATCH 1/4] fix(core): root-cause the id-less media wash in getAttr, drop the band-aid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The blank-wash/dropped-audio fix in #1790 added assignMissingMediaIds in the producer to stamp ids onto id-less timed media. That was a band-aid: the real cause is timingCompiler's getAttr, whose regex had no name boundary at all, so getAttr(tag, "id") matched the trailing id="…" inside data-hf-id="…". compileTag saw a phantom id and skipped its existing hf-video-N/hf-audio-N injection, leaving the element with no real el.id — which the render pipeline keys off of. Fix getAttr with the same (? (the dropped- audio side, previously untested) and raises minAudioCorrelation to 0.9. Adds a timingCompiler test for the data-hf-id/id boundary. --- .../core/src/compiler/timingCompiler.test.ts | 12 ++++++ packages/core/src/compiler/timingCompiler.ts | 8 +++- .../producer/src/services/htmlCompiler.ts | 36 +----------------- .../producer/tests/video-hfid-no-id/meta.json | 2 +- .../tests/video-hfid-no-id/src/clip.mp4 | Bin 814218 -> 833851 bytes .../tests/video-hfid-no-id/src/index.html | 12 ++++++ 6 files changed, 33 insertions(+), 37 deletions(-) diff --git a/packages/core/src/compiler/timingCompiler.test.ts b/packages/core/src/compiler/timingCompiler.test.ts index b7dcf044c3..c83ad5226d 100644 --- a/packages/core/src/compiler/timingCompiler.test.ts +++ b/packages/core/src/compiler/timingCompiler.test.ts @@ -16,6 +16,18 @@ describe("compileTimingAttrs", () => { expect(unresolved).toHaveLength(0); }); + it("injects a real id when the element has only data-hf-id (not a phantom match)", () => { + // Regression: getAttr(tag, "id") matched the trailing id="…" inside + // data-hf-id="…" and returned a phantom, so compileTag skipped its + // hf-video-N injection — leaving no real el.id and a blank-wash render. + const html = '