Skip to content

chore(protocol): replace EventTarget interface with __waitInfo__ message#40718

Open
dgozman wants to merge 2 commits intomicrosoft:mainfrom
dgozman:chore-eventtarget-waitinfo
Open

chore(protocol): replace EventTarget interface with __waitInfo__ message#40718
dgozman wants to merge 2 commits intomicrosoft:mainfrom
dgozman:chore-eventtarget-waitinfo

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented May 7, 2026

Summary

  • Drops the synthetic EventTarget protocol interface and per-channel waitForEventInfo plumbing.
  • Replaces it with a fire-and-forget __waitInfo__ message validated against a new WaitInfo struct (handled in dispatcher.dispatch() alongside __create__/__adopt__/__dispose__).
  • Client Waiter builds the Wait for event "<event>" title locally and goes through _wrapApiCall, preserving trace-viewer and test-runner step titles.

Drops the synthetic `EventTarget` interface and its `waitForEventInfo` method.
The before/log/after wait notifications now travel as a fire-and-forget
`__waitInfo__` message validated against a new `WaitInfo` struct, mirroring
how `__create__`/`__adopt__`/`__dispose__` are handled.

The client-side `Waiter` builds the action title locally and sends through
`_wrapApiCall` so trace viewer and test runner steps render the same
`Wait for event "<event>"` text as before.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Fire-and-forget __waitInfo__ in sendMessageToServer was throwing on a
closed connection and the void'd promise leaked as an unhandled
rejection, surfacing as "Error: Browser closed" in tests. Silently drop
it instead, matching the fire-and-forget contract.

Also extend the trace test to expect the new "Wait for event ..." title
attached to __waitInfo__'s before event.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Test results for "MCP"

9 failed
❌ [chrome] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation @mcp-windows-latest-chrome
❌ [chrome] › mcp/test-run.spec.ts:126 › test_run should stop when aborted @mcp-windows-latest-chrome
❌ [firefox] › mcp/cli-core.spec.ts:31 › close @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-devtools.spec.ts:217 › video-start-stop @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-devtools.spec.ts:231 › video-chapter @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:123 › daemon show: closing page exits the process @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:159 › save recording streams WebM bytes to the chosen file @mcp-windows-latest-firefox
❌ [firefox] › mcp/test-run.spec.ts:126 › test_run should stop when aborted @mcp-windows-latest-firefox
❌ [webkit] › mcp/config.spec.ts:138 › browser_get_config returns merged config from file, env and cli @mcp-windows-latest-webkit

7022 passed, 1068 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Test results for "tests 1"

4 flaky ⚠️ [installation tests] › playwright-test-package-managers.spec.ts:19 › npm: @playwright/test should work `@package-installations-windows-latest`
⚠️ [installation tests] › playwright-test-package-managers.spec.ts:38 › npm: @playwright/test + playwright-core should work `@package-installations-windows-latest`
⚠️ [chromium-library] › library/video.spec.ts:476 › screencast › should capture static page in persistent context @smoke `@chromium-ubuntu-22.04-node22`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:812 › should update state on subsequent run `@windows-latest-node20`

41692 passed, 850 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants