Repository navigation
fix: leave unbound guids in event payloads untouched instead of closing the connection - #642
Merged
mxschmitt merged 1 commit intoSep 14, 2026
Conversation
(cherry picked from commit 9549483)
|
Follow-up I wanted on this branch: a live Chromium regression ( I could not push it here — Bugbot on the branch (fix + that test) found no bugs. The change LGTM. |
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.
Problem
Since the guid-resolution rewrite,
connection.Dispatchtreats any map carrying aguidkey inside event params as a reference to a bound protocol object, and if the lookup fails it callscleanup(...)on the whole connection. From then on every call on thatPlaywrightinstance fails withtarget closed: failed to resolve event parameters for event: failed to resolve map key 'params': object with guid <uuid> was not bound in the connection.Raw CDP payloads relayed through
CDPSession(eventwith{method, params}) legitimately contain such keys: Chrome'sPage.downloadWillBeginandPage.downloadProgresscarry aguidthat names a download, not a Playwright object. So the first download seen by any page with aCDPSessionthat hasPage.enabled permanently kills the process's driver connection.Reproduction (v0.5700.1, stock driver):
NewCDPSession(page)→Page.enable→Page.setDownloadBehavior allow→page.Goto(url that serves Content-Disposition: attachment). Afterwardsbrowser.NewContext()and evenpw.Chromium.Launch()return the error above.Fix
Mirror the reference JS client (
_replaceGuidsWithChannels): aguidthat names a bound object resolves to its channel; any otherguidvalue is plain data and the map is walked like every other map. This is also how playwright-go behaved before the rewrite (v0.5200.0 never errored here).Two unit tests drive
Dispatchdirectly: one asserts an unbound download guid reaches theeventlistener intact and the connection stays open; the other asserts bound guids (top-level and nested in a slice) still resolve to channels.🤖 Generated with Claude Code
https://claude.ai/code/session_01Uotgs1HWeELTqn9fLggWoH