Skip to content

Commit b9b39db

Browse files
committed
👷 update pinnedProxy for playwright 1.61: drop __waitInfo__ messages
- Update version references from 1.60 to 1.61 in comments - Drop __waitInfo__ fire-and-forget messages added in 1.61 to avoid "Cannot find command to respond" errors from the 1.40 pinned server
1 parent 9c19ff3 commit b9b39db

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎test/e2e/scripts/pinnedProxy.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// WebSocket translation proxy that lets a recent @playwright/test client (1.60) drive an
1+
// WebSocket translation proxy that lets a recent @playwright/test client (1.61) drive an
22
// older `playwright run-server` (1.40). Two layers of translation:
33
//
44
// 1) HTTP upgrade — the 1.40 server's User-Agent version check rejects mismatched clients
@@ -10,7 +10,7 @@
1010
//
1111
// Patches were derived from a diff of the JSON-RPC protocol schema in packages/protocol/src
1212
// (`protocol.yml` up to v1.59.1, `channels.d.ts` from v1.60.0 onward — `protocol.yml` was
13-
// removed in 1.60) between v1.40.1 and v1.60.0 — only the divergences exercised by this
13+
// removed in 1.60) between v1.40.1 and v1.61.0 — only the divergences exercised by this
1414
// repo's e2e tests are translated.
1515
//
1616
// Usage: node pinnedProxy.ts --listen 5400 --upstream 127.0.0.1:5401
@@ -269,6 +269,15 @@ function rewriteClientToServer(
269269
if (typeof msg.method !== 'string') {
270270
return text
271271
}
272+
273+
// __waitInfo__ is a fire-and-forget instrumentation message added in 1.61 (replacing the
274+
// old EventTargetChannel.waitForEventInfo pattern). The client never registers a callback
275+
// for it, so if the 1.40 server receives it and sends back an error response, the client
276+
// throws "Cannot find command to respond: <id>". Drop it instead of forwarding.
277+
if (msg.method === '__waitInfo__') {
278+
return null
279+
}
280+
272281
const type = msg.guid ? guidTypes.get(msg.guid) : undefined
273282
const params = msg.params || {}
274283

0 commit comments

Comments
 (0)