Repository navigation
fix(browser): clean up failed guarded navigation routes - #113753
Merged
steipete merged 1 commit intoJul 25, 2026
Merged
Conversation
steipete
deleted the
codex/fix-autoqa-browser-navigation-route-cleanup-1bfd
branch
July 25, 2026 16:17
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 26, 2026
) Co-authored-by: Peter Steinberger <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where browser users could be left with a stale request-interception route after Playwright failed to set up guarded navigation. It also fixes successful navigations silently ignoring route-removal failures while the target page remains open, causing later browser requests on that tab to run with inconsistent interception state.
The issue is real for the pinned
[email protected]: itsPage.routeregisters the exact client-side handler before awaiting fallible browser interception setup.Why This Change Was Made
Reuse the already existing
removePageNavigationRequestGuardowner helper and the established sibling post-cleanup decision pattern. Roll back only the failed navigation’s exact route, preserve the original setup or navigation failure, report cleanup failures for live pages, ignore expected cleanup failures after a page closes, and maintain blocked-navigation quarantine and policy precedence.All result decisions occur after cleanup; no value is returned and no error is thrown from a
finallyblock. There are no changes to browser security policy, Chrome or IME code, config, consent, dependencies, persistence, or protocols.User Impact
A failed browser navigation no longer leaves behind a hidden interception handler affecting subsequent requests on the same tab. Open-page interception cleanup failures are accurately returned; closed-tab cleanup remains harmless; and blocked targets are still quarantined and closed.
Evidence
1bfd207a5405c38d04b052c8eb7291cadabce99e; only the canonical browser-navigation owner and its existing owner test are changed.1.61.1upstream source at39e3553a4f283a41134d75d7e404484bd9e6865a:Page.routeregisters its handler before the fallible interception-pattern update, andPage.unrouteremoves only the matching handler.node scripts/check-changed.mjs --base HEAD -- extensions/browser/src/browser/pw-session-navigation.ts extensions/browser/src/browser/pw-session.create-page.navigation-guard.test.ts; passed production/test typechecks, formatting, exact-owner lint, dependency/plugin boundaries, and all required guards. Authoritative remote timing: 278,833 ms; exit code 0.pnpm test \ extensions/browser/src/browser/pw-session.create-page.navigation-guard.test.ts \ extensions/browser/src/browser/navigation-guard.test.ts \ extensions/browser/src/browser/pw-session.assert-navigation-safety.test.ts \ extensions/browser/src/browser/pw-tools-core.interactions.navigation-guard.test.ts \ extensions/browser/src/browser/pw-tools-core.snapshot.navigate-guard.test.ts \ extensions/browser/src/browser/routes/agent.act.existing-session-navigation-guard.test.ts \ extensions/browser/src/browser/pw-session.termination-cdp-ssrf.test.ts \ extensions/browser/src/browser/server-context.remote-profile-tab-ops.playwright.test.ts \ extensions/browser/src/browser/server-context.remote-profile-tab-ops.fallback.test.ts \ extensions/browser/src/browser/pw-session.connections.test.ts \ extensions/browser/src/browser/pw-session.test.ts \ extensions/browser/src/browser/pw-session.page-cdp.test.ts \ extensions/browser/src/browser/pw-tools-core.browser-ssrf-guard.test.ts \ extensions/browser/src/browser/pw-tools-core.snapshot.test.ts node scripts/check-changed.mjs --base HEAD -- \ extensions/browser/src/browser/pw-session-navigation.ts \ extensions/browser/src/browser/pw-session.create-page.navigation-guard.test.tsAI-assisted; true-red reproduction, pinned upstream dependency contract, sibling owner semantics, and final cleanup/error precedence independently reviewed.