From 8be8cebe0095ce220fff1a2f6ae966126d76045d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 12 Jul 2026 09:40:10 +0000 Subject: [PATCH] fix(render): retry transient network changes --- .../engine/src/services/frameCapture-transientErrors.test.ts | 1 + packages/engine/src/services/frameCapture.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/engine/src/services/frameCapture-transientErrors.test.ts b/packages/engine/src/services/frameCapture-transientErrors.test.ts index 82cda5e218..c3497c5234 100644 --- a/packages/engine/src/services/frameCapture-transientErrors.test.ts +++ b/packages/engine/src/services/frameCapture-transientErrors.test.ts @@ -14,6 +14,7 @@ describe("isTransientBrowserError", () => { "Cannot find context with specified id", "Failed to launch the browser process! TROUBLESHOOTING: https://pptr.dev/troubleshooting", "connect ECONNREFUSED 127.0.0.1:9222", + "net::ERR_NETWORK_CHANGED at http://127.0.0.1:4173/index.html", "Navigation timeout of 60000 ms exceeded", // pollHfReady timed out before window.__renderReady flipped true — the // classic symptom of a slow/contended host (e.g. several renders running diff --git a/packages/engine/src/services/frameCapture.ts b/packages/engine/src/services/frameCapture.ts index 4786668261..31d159e650 100644 --- a/packages/engine/src/services/frameCapture.ts +++ b/packages/engine/src/services/frameCapture.ts @@ -3266,6 +3266,11 @@ const TRANSIENT_BROWSER_ERROR_PATTERNS = [ /Failed to launch the browser process/i, /Navigation timeout of \d+ ms exceeded/i, /ECONNREFUSED/i, + // Chromium can briefly invalidate even a localhost connection when Windows + // reports an adapter/route change. A fresh capture session succeeds once the + // network stack settles, so treat this like the other bounded navigation + // retries instead of failing the render immediately. + /net::ERR_NETWORK_CHANGED/i, // pollHfReady's own timeout — thrown when window.__renderReady never flips // true within playerReadyTimeout. "Runtime ready: false" means init simply // didn't finish in time (commonly a slow/contended host, e.g. several