Skip to content

Commit c58a6ab

Browse files
committed
fix(cli): drop added comments to keep comment share at merge-base
1 parent be3f177 commit c58a6ab

2 files changed

Lines changed: 0 additions & 23 deletions

File tree

‎packages/cli/src/capture/coreExtractionPhase.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,6 @@ export async function runCoreExtraction(input: CoreExtractionInput): Promise<Cor
310310
await runAnimationCapture();
311311

312312
const runHtmlExtraction = async (): Promise<void> => {
313-
// The screenshot stage already settles consent-click reloads; this is a
314-
// bounded readyState guard — one evaluate on a parsed page — so the
315-
// catalog never reads a still-loading or mid-navigation document.
316313
await waitForPageReady(page1, {
317314
timeoutMs: Math.min(15_000, remainingMs()),
318315
networkIdle: "after-load",

‎packages/cli/src/capture/navigateForCapture.ts‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,7 @@ export interface PageReadyPage {
7272
}
7373

7474
export interface WaitForPageReadyOptions {
75-
/**
76-
* Wall-clock ceiling shared by the idle waits and the readyState poll —
77-
* each wait gets only the time still left. Pass the remaining capture
78-
* budget (min'd with 15_000) so the settle cannot outrun the stage.
79-
*/
8075
timeoutMs?: number;
81-
/**
82-
* "always" pays one bounded idle wait up front — the post-click settle,
83-
* where a navigation or consent XHR is expected. "after-load" skips that
84-
* wait and idles only when the poll actually saw a loading document — a
85-
* cheap guard for stages that already settled the page.
86-
*/
8776
networkIdle?: "always" | "after-load";
8877
}
8978

@@ -96,18 +85,11 @@ export async function waitForPageReady(
9685
const remaining = () => Math.max(0, deadline - Date.now());
9786
const idle = () =>
9887
page
99-
// concurrency: 2 matches the networkidle2 semantic navigation already
100-
// uses, so one held-open request (long-poll, beacon) cannot block it.
10188
.waitForNetworkIdle({ idleTime: 500, timeout: remaining(), concurrency: 2 })
10289
.catch(() => {});
10390

10491
if (networkIdle === "always" && remaining() > 0) await idle();
10592

106-
// Poll the document out of a still-loading or mid-navigation state. The
107-
// bound is wall clock, not iteration count: each evaluate races the
108-
// remaining deadline, so a hung execution-context wait (~30s, or the
109-
// protocol timeout) cannot stretch the settle. Degradable protocol/stage
110-
// timeouts rethrow so the stage can degrade like the rest of capture.
11193
let waitedOutLoad = false;
11294
while (remaining() > 0) {
11395
let timer: ReturnType<typeof setTimeout> | undefined;
@@ -131,7 +113,5 @@ export async function waitForPageReady(
131113
}
132114
}
133115

134-
// A document we had to wait out keeps fetching once parsed — settle those
135-
// requests too, inside the same deadline.
136116
if (waitedOutLoad && remaining() > 0) await idle();
137117
}

0 commit comments

Comments
 (0)