fix(core): set __renderReady unconditionally after binding attempt

The capturedTimeline guard broke CSS/WAAPI/Lottie compositions that
have no GSAP timeline — __renderReady was never set, causing the
parity harness to timeout after 30s.

renderSeek works with or without a GSAP timeline (adapter-only
seeking), so the correct invariant is "timeline binding was
attempted" not "a timeline was found." Set __renderReady
unconditionally in all three paths, after bindRootTimelineIfAvailable
has run.
This commit is contained in:
Miguel Ángel
2026-05-24 13:42:30 -04:00
parent 3347486ae9
commit 1d09e6ff36
2 changed files with 8 additions and 12 deletions
+2 -2
View File
@@ -557,7 +557,7 @@ describe("initSandboxRuntimeModular", () => {
expect(window.__player).toBeDefined();
});
it("does not set __renderReady when no timeline is available", () => {
it("sets __renderReady even without a GSAP timeline (CSS/WAAPI compositions)", () => {
const root = document.createElement("div");
root.setAttribute("data-composition-id", "main");
root.setAttribute("data-root", "true");
@@ -571,6 +571,6 @@ describe("initSandboxRuntimeModular", () => {
initSandboxRuntimeModular();
expect(window.__playerReady).toBe(true);
expect(window.__renderReady).toBeUndefined();
expect(window.__renderReady).toBe(true);
});
});
+6 -10
View File
@@ -1460,9 +1460,7 @@ export function initSandboxRuntimeModular(): void {
.finally(() => {
externalCompositionsReady = true;
bindRootTimelineIfAvailable();
if (state.capturedTimeline) {
window.__renderReady = true;
}
window.__renderReady = true;
runAdapters("discover", state.currentTime);
bindMediaMetadataListeners();
installAssetFailureDiagnostics();
@@ -1633,11 +1631,11 @@ export function initSandboxRuntimeModular(): void {
player._timeline = state.capturedTimeline;
}
// __renderReady = timeline is bound, safe for deterministic seeking.
// __renderReady = timeline binding attempted, safe for deterministic seeking.
// Set unconditionally: renderSeek works with or without a GSAP timeline
// (CSS/WAAPI/Lottie compositions use adapter-only seeking).
// fileServer.ts sets this immediately (no timeline to bind in its runtime).
if (state.capturedTimeline) {
window.__renderReady = true;
}
window.__renderReady = true;
// When the bundler inlines compositions, data-composition-src is removed so
// loadExternalCompositions() is skipped. But inline scripts registering child
@@ -1650,9 +1648,7 @@ export function initSandboxRuntimeModular(): void {
player._timeline = state.capturedTimeline;
}
runAdapters("discover", state.currentTime);
if (state.capturedTimeline) {
window.__renderReady = true;
}
window.__renderReady = true;
postTimeline();
postState(true);
}, 0);