mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
fix: revert flattenInnerRoot, use host-level authored-id + count-based rebind
Three changes to fix regression failures without breaking baselines: 1. Revert flattenInnerRoot in producer — use the original innerHTML inlining that preserves the existing DOM structure. Instead, set data-hf-authored-id on the HOST element so the scoped proxy can still rewrite #id selectors for sub-composition scripts. 2. Revert compiled.html baselines to main (no DOM structure changes). 3. Use timeline-count comparison instead of poll duration to decide whether to call __hfForceTimelineRebind. Compare timeline count before vs after the poll — rebind only when new timelines appeared during polling. This correctly identifies async compositions regardless of fetch speed, while leaving sync compositions untouched.
This commit is contained in:
@@ -365,10 +365,14 @@ async function pollSubCompositionTimelines(
|
||||
}
|
||||
return true;
|
||||
})()`;
|
||||
const beforePoll = Date.now();
|
||||
const timelinesBeforePoll = Number(
|
||||
await page.evaluate(`Object.keys(window.__timelines || {}).length`),
|
||||
);
|
||||
const ready = await pollPageExpression(page, expression, timeoutMs, intervalMs);
|
||||
const pollDurationMs = Date.now() - beforePoll;
|
||||
if (ready && pollDurationMs > intervalMs * 2) {
|
||||
const timelinesAfterPoll = Number(
|
||||
await page.evaluate(`Object.keys(window.__timelines || {}).length`),
|
||||
);
|
||||
if (ready && timelinesAfterPoll > timelinesBeforePoll) {
|
||||
await page.evaluate(`(function() {
|
||||
if (typeof window.__hfForceTimelineRebind === "function") {
|
||||
window.__hfForceTimelineRebind();
|
||||
|
||||
Reference in New Issue
Block a user