fix(core): only rebind timelines when late arrivals were actually detected

The late-bind polling was unconditionally rebinding on its first
check even when all timelines were already present, causing visual
regressions across style-prod tests. Now tracks sawMissing flag —
only rebinds if the poll previously detected missing timelines that
subsequently appeared. Compositions with synchronous timeline
registration exit the poll immediately with no side effects.
This commit is contained in:
Miguel Ángel
2026-05-18 05:24:33 -04:00
parent 04c35ce24c
commit d10b2f4ded
+3 -1
View File
@@ -1471,6 +1471,7 @@ export function initSandboxRuntimeModular(): void {
postState(true);
let lateBindChecks = 0;
let sawMissing = false;
const lateBindInterval = setInterval(() => {
if (++lateBindChecks > 50) {
clearInterval(lateBindInterval);
@@ -1482,10 +1483,11 @@ export function initSandboxRuntimeModular(): void {
const id = hosts[i].getAttribute("data-composition-id");
if (id && !timelines[id]) {
allBound = false;
sawMissing = true;
break;
}
}
if (allBound && lateBindChecks > 1) {
if (allBound && !sawMissing) {
clearInterval(lateBindInterval);
return;
}