Skip to content

Commit 8be8ceb

Browse files
committed
fix(render): retry transient network changes
1 parent 9d4ef6e commit 8be8ceb

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/engine/src/services/frameCapture-transientErrors.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe("isTransientBrowserError", () => {
1414
"Cannot find context with specified id",
1515
"Failed to launch the browser process! TROUBLESHOOTING: https://pptr.dev/troubleshooting",
1616
"connect ECONNREFUSED 127.0.0.1:9222",
17+
"net::ERR_NETWORK_CHANGED at http://127.0.0.1:4173/index.html",
1718
"Navigation timeout of 60000 ms exceeded",
1819
// pollHfReady timed out before window.__renderReady flipped true — the
1920
// classic symptom of a slow/contended host (e.g. several renders running

packages/engine/src/services/frameCapture.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3266,6 +3266,11 @@ const TRANSIENT_BROWSER_ERROR_PATTERNS = [
32663266
/Failed to launch the browser process/i,
32673267
/Navigation timeout of \d+ ms exceeded/i,
32683268
/ECONNREFUSED/i,
3269+
// Chromium can briefly invalidate even a localhost connection when Windows
3270+
// reports an adapter/route change. A fresh capture session succeeds once the
3271+
// network stack settles, so treat this like the other bounded navigation
3272+
// retries instead of failing the render immediately.
3273+
/net::ERR_NETWORK_CHANGED/i,
32693274
// pollHfReady's own timeout — thrown when window.__renderReady never flips
32703275
// true within playerReadyTimeout. "Runtime ready: false" means init simply
32713276
// didn't finish in time (commonly a slow/contended host, e.g. several

0 commit comments

Comments
 (0)