Skip to content

Commit 5508ff2

Browse files
jrusso1020claude
andcommitted
fix(engine): name animation frames in the setup-timeout hint
Setup that awaits requestAnimationFrame hits the same render-clock rule as setup that waits on Date or performance.now: frames only fire on a seek, and the first seek waits for setup. Say so, and point at the waits that work. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent e353a6d commit 5508ff2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/engine/src/services/frameCapture.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,8 @@ describe("buildZeroDurationDiagnostic", () => {
683683
);
684684
expect(message).not.toContain("zero duration");
685685
expect(message).toContain("data-duration: 6s");
686-
expect(message).toContain("Date and performance.now stay at 0 until the first frame");
686+
expect(message).toContain("requestAnimationFrame callbacks wait until the first frame");
687+
expect(message).toContain("Wait with setTimeout or scheduler.yield() instead.");
687688
});
688689

689690
it("does not guess at duration inference while setup is still pending", () => {

‎packages/engine/src/services/frameCapture.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,8 +1896,9 @@ export function buildZeroDurationDiagnostic(diag: HfDiagnostic, timeoutMs?: numb
18961896
`window.__hf.buildReady never resolved for: ${diag.pendingBuildReadyKeys.join(", ")}. ` +
18971897
"The runtime holds render-ready until every registered buildReady promise settles. " +
18981898
"Find where the composition registers that key and confirm it actually resolves. " +
1899-
"During a render, Date and performance.now stay at 0 until the first frame, so setup " +
1900-
"that waits for the clock to advance never finishes.",
1899+
"During a render, Date and performance.now stay at 0 and requestAnimationFrame " +
1900+
"callbacks wait until the first frame, so setup that awaits an animation frame or " +
1901+
"the clock never finishes. Wait with setTimeout or scheduler.yield() instead.",
19011902
);
19021903
}
19031904
if (diag.rejectedBuildReadyKeys.length > 0) {

0 commit comments

Comments
 (0)