Skip to content

chore(webview): generalize dialog bridge into SyncServer#41878

Open
pavelfeldman wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:chore-webview-sync-server
Open

chore(webview): generalize dialog bridge into SyncServer#41878
pavelfeldman wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:chore-webview-sync-server

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Generalize the WebView DialogBridge into a reusable SyncServer (JSON in / JSON out).
  • Each handler is registered under an unguessable guid path, so the endpoint can't be discovered by page-side scripts just from the randomly bound port.
  • WVPage now owns registering/unregistering its own dialog handler and keeps the dialog-specific request interpretation.

Turn the WebKit WebView DialogBridge into a generic SyncServer that
routes each handler under an unguessable guid path, so the endpoint
cannot be discovered by page-side scripts just by knowing the randomly
bound port. addHandler returns a disposable { endpoint, dispose } and
WVPage owns registering/unregistering its own dialog handler while
keeping the dialog-specific request interpretation.
@pavelfeldman
pavelfeldman force-pushed the chore-webview-sync-server branch from 0f78bf2 to 90f58d0 Compare July 20, 2026 15:21
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [installation tests] › playwright-cdn.spec.ts:43 › playwright cdn failover should work (https://cdn.playwright.dev) @package-installations-ubuntu-latest

3 flaky ⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:371 › should produce network events, routing, and annotations for Service Worker `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node20`

49965 passed, 1188 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

3 failed
❌ [chrome] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation @mcp-macos-latest-chrome
❌ [chrome] › mcp/cli-navigation.spec.ts:43 › tab-new with url @mcp-macos-latest-chrome
❌ [chromium] › mcp/annotate.spec.ts:173 › user-initiated annotate downloads zip with feedback.md @mcp-macos-latest-chromium

7757 passed, 1249 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a look at the failing CI.

🟢 The one failure is unrelated to this PR — CI is clear

The single red test is playwright-cdn.spec.ts:43 › playwright cdn failover should work on package-installations-ubuntu-latest. It's a CDN download failure (npx playwright install exited 1 while pulling Chrome from cdn.playwright.dev), which this WebKit WebView SyncServer refactor can't touch.

Details

This PR only refactors packages/playwright-core/src/server/webkit/webview/ (dialog bridge → SyncServer). None of the failing surfaces exercise that code.

Pre-existing flake / infra

  • [installation tests] › playwright-cdn.spec.ts:43 › playwright cdn failover should work (https://cdn.playwright.dev) — network/infra, not a code failure. The error is npx playwright install exiting 1 mid-download of the Chrome build from the CDN. Across the test-results DB this test's final verdict flips: failed 2 of 420 runs, passed 418, and the other failure was on PR feat(webkit): roll to r2327 #41684 (sha 922cd4cf) — a different PR, so this test breaks where this branch can't be responsible. Nothing in the WebView SyncServer change reaches the install/CDN path.

Also seen (already green)

  • 3 flaky, all self-rescued on retry and unrelated to WebView: library/video.spec.ts:736, library/chromium/chromium.spec.ts:371 (Service Worker), library/video.spec.ts:699.

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a look at the failing CI.

🟢 All failures are pre-existing flakes / infra — this PR is clear

This PR only refactors the WebKit WebView dialog bridge into SyncServer (packages/playwright-core/src/server/webkit/webview/). None of the failing surfaces — a CDN install test and three MCP tests on macOS Chrome/Chromium — go anywhere near that code, and every one of them is a known flake that fails on unrelated SHAs.

Details

Pre-existing flake / infra

  • [installation tests] › playwright-cdn.spec.ts:43 › playwright cdn failover should work — network/infra, npx playwright install exiting 1 mid-download from cdn.playwright.dev. Across the DB it flips failed 2 of 420 runs, passed 418, and the other failure was on PR feat(webkit): roll to r2327 #41684 (sha 922cd4cf) — a different PR. The install/CDN path doesn't touch the WebView change.

  • [chrome] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation — bimodal flake: failed 7 of 302 chrome runs, and fails on 4 other SHAs (dbb805e6, a89eab73, 9c551255, 90cbbbb9), not this branch.

  • [chrome] › mcp/cli-navigation.spec.ts:43 › tab-new with url — flake: failed 1 of 302 chrome runs, also failed on sha c51e3f58, a different branch.

  • [chromium] › mcp/annotate.spec.ts:173 › user-initiated annotate downloads zip with feedback.md — one of the flakiest of the group: final verdict flips 12/297 (firefox), 11/304 (webkit), 2/301 (chromium), failing across 6 distinct SHAs unrelated to this PR.

The MCP tools exercise Chrome/Chromium/CDP; a WebKit WebView SyncServer refactor can't reach them.

Also seen (already green)

  • 3 flaky, all self-rescued on retry and unrelated to WebView: library/video.spec.ts:736, library/chromium/chromium.spec.ts:371 (Service Worker), library/video.spec.ts:699.

Triaged by the Playwright bot - agent 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.

1 participant