chore: do not abort operations upon dispatcher being disposed#40893
Merged
Conversation
The server-side library should correctly resolve/reject any calls instead.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The compilation cache fix and the server-side resolve/reject behavior already handle resuming a paused debugger when the context closes, so the explicit resume() call is unnecessary.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
These operations relied on dispatcher disposal aborting in-flight progress. Make the server-side library terminate them itself: - pickLocator races against page.openScope - waitForTimeout races against page close / frame detach - request context dispose rejects with a TargetClosedError
Contributor
Test results for "MCP"1 failed 7115 passed, 1113 skipped Merge workflow run. |
This comment has been minimized.
This comment has been minimized.
pavelfeldman
approved these changes
May 19, 2026
The previous commit relied on dispatcher disposal aborting in-flight progress to make late route.fetch() calls reject with TargetClosedError. With that aborting removed, a request sent before _sendRequest attached its Dispose listener could either complete successfully or hang. Track _disposed on APIRequestContext and reject in _sendRequest right after _updateRequestCookieHeader so that any request reaching the HTTP layer after disposal fails with TargetClosedError. Also make the playwright.fetch unrouteAll-hint test deterministic by waiting for the page to actually close before invoking the late fetch.
Contributor
Test results for "tests 1"2 flaky42031 passed, 850 skipped Merge workflow run. |
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.
The server-side library should correctly resolve/reject any calls instead.