fix(server): keep pages alive when a reuse-mode connection drops - #42461
Closed
Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Closed
fix(server): keep pages alive when a reuse-mode connection drops#42461Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Conversation
In extension mode, test-run connections engage the reuse-browsers mode,
which deliberately keeps pages alive across connections ("Don't close
the pages so that user could debug them"). However, the shared browser
was not marked as shared, so the connection cleanup treated the
contexts created by the connection as isolated and closed them all on
disconnect ("Global context cleanup"), killing the page being debugged.
Mark the browser as shared in reuse-browsers mode, so contexts with
pages survive the connection drop and are picked up by the next
connection. Empty contexts are still cleaned up on disconnect as
before.
This restores the pre-1.54 behavior where stopping a debug session in
the VS Code extension keeps the browser open for inspection and
recording.
Fixes: microsoft#37822
This was referenced Aug 29, 2026
Collaborator
|
I don't think we want this particular fix. Let us look into the original issue though. |
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.
Summary
sharedBrowser: truein reuse-browsers mode, so contexts created by a connection are no longer treated as isolated and killed wholesale by the connection cleanup when the connection dropsFixes #37822
The extension-side hardening (backend teardown on transient zero page count) is in the companion PR: microsoft/playwright-vscode#808
Related: #42458 fixes stale recorder actions leaking between "Record at cursor" sessions (#42218).