Repository navigation
fix(browser): stop failing goto when a redirect or download aborts the load - #9822
Conversation
…e load Electron's loadURL rejects with ERR_ABORTED (-3) when the initial navigation is superseded — a client-side/meta redirect (common in SSO flows) or a download-triggered load. Since #9633 drives goto through wc.loadURL directly, that rejection surfaced as a spurious 'Failed to navigate' browser_error even though the page landed fine. Treat ERR_ABORTED like offscreen-browser-backend already does: resolve with the page's actual URL/title. Every other loadURL failure still fails closed.
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 994c30f8-00e5-404f-8ebd-3acb3664078b
📒 Files selected for processing (2)
src/main/browser/agent-browser-bridge.test.tssrc/main/browser/agent-browser-bridge.ts
…e load (stablyai#9822) * fix(browser): stop failing goto when a redirect or download aborts the load Electron's loadURL rejects with ERR_ABORTED (-3) when the initial navigation is superseded — a client-side/meta redirect (common in SSO flows) or a download-triggered load. Since stablyai#9633 drives goto through wc.loadURL directly, that rejection surfaced as a spurious 'Failed to navigate' browser_error even though the page landed fine. Treat ERR_ABORTED like offscreen-browser-backend already does: resolve with the page's actual URL/title. Every other loadURL failure still fails closed. * fix(browser): settle replacement navigation after abort * fix(browser): clean up aborted navigation destruction race
What
Embedded-browser
gotono longer reports a spurious failure when ElectronloadURLrejects withERR_ABORTED (-3)for a superseded or download-triggered load.The abort path now distinguishes three outcomes:
Every non-abort
loadURLerror remains unchanged.Why
#9633 moved embedded
gotofrom the daemon helper to directWebContents.loadURL. Electron rejects withERR_ABORTEDwhen that load is superseded, even though the browser can continue to a usable replacement page. Surfacing that rejection directly caused successful SSO/login flows to reportFailed to navigate browser page ...: ERR_ABORTED (-3).Testing against the pinned Electron 43.1.0 runtime also showed why a bare catch-and-ignore is unsafe:
getURL()returns the old page;beforeunloadalso producesERR_ABORTED, but the requested navigation did not happen.The bridge therefore waits only when an aborted load has an in-flight replacement, uses
did-stop-loadingrather than polling, keeps the existing 30-second total budget, cleans up its timer/listeners on success, timeout, and destruction, and re-checks BrowserManager load state before reporting success.Tests
Added coverage for:
beforeunloadveto → fails closed;Verification:
agent-browser-bridge.test.ts: 103/103git diff --checkA full local suite under unsupported Node 26 completed 33,665 passing tests; its unrelated failures were Node-24/environment-sensitive localStorage, inherited Git environment, and timeout tests. PR CI runs the supported Node version.