mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
fix(engine): log composition-id attribution on script-failure bail too
Address max-effort code-review finding on PR #2045 (confirmed, not addressed by the earlier review-gap commit): the script_failure bail path skipped the composition-id enumeration entirely, so a render with multiple sub-compositions sharing a failed script only logged the raw failed URL(s), never which composition(s) were still waiting on it — a real observability regression versus the pre-#2045 behavior, which always logged the missing-id list on any non-ready outcome. Now enumerate unregistered composition ids unconditionally and log them alongside whichever reason (script_failure or natural timeout) fired.
This commit is contained in:
@@ -1214,18 +1214,24 @@ export async function pollSubCompositionTimelines(
|
|||||||
})()`);
|
})()`);
|
||||||
return "ready";
|
return "ready";
|
||||||
}
|
}
|
||||||
if (!scriptFailureBail) {
|
// Enumerate the still-unregistered composition ids regardless of bail
|
||||||
const missing = await page.evaluate(`(function() {
|
// reason — a script-failure bail used to skip this entirely, so a render
|
||||||
var hosts = document.querySelectorAll("[data-composition-id]");
|
// with multiple sub-compositions only named the failed script URL(s), not
|
||||||
var timelines = window.__timelines || {};
|
// which composition(s) it was still waiting on (review).
|
||||||
var m = [];
|
const missing = await page.evaluate(`(function() {
|
||||||
for (var i = 0; i < hosts.length; i++) {
|
var hosts = document.querySelectorAll("[data-composition-id]");
|
||||||
if (hosts[i].hasAttribute("data-no-timeline")) continue;
|
var timelines = window.__timelines || {};
|
||||||
var id = hosts[i].getAttribute("data-composition-id");
|
var m = [];
|
||||||
if (id && !timelines[id]) m.push(id);
|
for (var i = 0; i < hosts.length; i++) {
|
||||||
}
|
if (hosts[i].hasAttribute("data-no-timeline")) continue;
|
||||||
return m.join(", ");
|
var id = hosts[i].getAttribute("data-composition-id");
|
||||||
})()`);
|
if (id && !timelines[id]) m.push(id);
|
||||||
|
}
|
||||||
|
return m.join(", ");
|
||||||
|
})()`);
|
||||||
|
if (scriptFailureBail) {
|
||||||
|
console.warn(`[FrameCapture] Composition(s) still waiting on the failed script: ${missing}.`);
|
||||||
|
} else {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[FrameCapture] Sub-composition timelines not registered after ${timeoutMs}ms: ${missing}. ` +
|
`[FrameCapture] Sub-composition timelines not registered after ${timeoutMs}ms: ${missing}. ` +
|
||||||
`Compositions that load data asynchronously (e.g. fetch) must register window.__timelines[id] after setup completes. ` +
|
`Compositions that load data asynchronously (e.g. fetch) must register window.__timelines[id] after setup completes. ` +
|
||||||
|
|||||||
Reference in New Issue
Block a user