fix(server): preview navigation waits for the busy script to stop #30670
ClosedElliotDrel(GitHub profile, opens in a new tab)wants to merge 2 commits into
fix/issue-28141 fromrefs/pull/30670/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/preview/ServerBrowser.test.ts line 814OutdatedResolvedby ElliotDrel(GitHub profile, opens in a new tab)@@ -763,0 +794,21 @@794+ renderer.terminationAck = Promise.withResolvers<void>();795+ renderer.terminationRequested = Promise.withResolvers<void>();796+ renderer.gotoStarted = Promise.withResolvers<void>();797+798+ const navigation = yield* broker799+ .invoke({800+ scope,801+ tabId,802+ operation: "navigate",803+ input: { url: "http://localhost:5173/next", readiness: "none", timeoutMs },804+ })805+ .pipe(Effect.exit, Effect.forkScoped);806+ yield* Effect.promise(() => renderer.terminationRequested.promise);807+ if (acknowledge) renderer.terminationAck.resolve();808+ yield* Effect.promise(() => renderer.gotoStarted.promise);809+ const [url, gotoOptions] = page.goto.mock.calls.at(-1)!;810+ expect(url).toBe("http://localhost:5173/next");811+ // An acknowledged termination leaves a renderer that commits instead of stalling.812+ expect(renderer.stalledGotos).toHaveLength(acknowledge ? 0 : 1);813+ // Waiting for the script to stop comes out of the navigation's own budget.814+ expect(gotoOptions?.timeout).toBeLessThanOrEqual(gotoTimeoutAtMost);
ElliotDrel(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
6994c4eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.