Skip to content

fix(route): preserve JSON fulfillment content types - #44149

Merged
Yury Semikhatsky (yury-s) merged 1 commit into
mainfrom
triage/44109/43960048500-1
Nov 18, 2026
Merged

Yury Semikhatsky (yury-s) merged 1 commit into
mainfrom
triage/44109/43960048500-1

Conversation

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor

Route._innerFulfill checked JSON truthiness when choosing the content type and replaced caller-provided headers. Check for undefined instead and default the normalized header only when missing. An explicit contentType still takes priority.

Extends the existing JSON fulfillment test for the reported values, both header casings, and the explicit override.

Fixes #44109

Triaged on Linux by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 failed
❌ [playwright-test] › reporter-junit.spec.ts:350 › created › should add file attribute relative to fileRoot @playwright-x64-server2025-64-core-node22
❌ [playwright-test] › reporter-junit.spec.ts:350 › merged › should add file attribute relative to fileRoot @playwright-x64-server2025-64-core-node22

1 flaky ⚠️ [firefox-page] › page/page-event-pageerror.spec.ts:289 › ER-022 should not fire for a caught fetch rejected by a pending navigation `@firefox-playwright-x64-ubuntu24-64-core-node22`

23643 passed, 716 skipped


Merge workflow run.

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor Author

🟢 Both failures predate this PR

Hi, I'm the Playwright bot. I checked the failures; neither was caused by this PR.

Evidence and suggested correction

Checked tests 1, run 43961721698 at 457736bbb5f8c8d5666731e9757019b24817f77b.

Pre-existing failures — not flakes

  • reporter-junit.spec.ts:350 › created / merged › should add file attribute relative to fileRoot — both Windows variants fail at line 374: expected auth/a.test.js, received auth\a.test.js. Both have the identical failure on the PR's base commit, 826ce42b8664ea940424e77ce51f1cdf96dcd37f, in the earlier main job.
  • The PR changes only JSON route fulfillment and its page test. These JUnit tests run assertion-only inline tests, with no route fulfillment; neither the reporter nor the failing test changed.

The classname uses the platform's path separators, while the new file attribute is explicitly normalized to /. The small correction is to expect path.join('auth', 'a.test.js') for classname at line 374, leaving the file expectations unchanged.

The Firefox page-error test passed on retry and is not a final failure.

Checked the failures on Linux by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

3 failed
❌ [chrome] › mcp/crash.spec.ts:31 › crash recovery › reports the navigation error, then resets and logs the crash @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/crash.spec.ts:58 › crash recovery › lists only one tab @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/crash.spec.ts:79 › crash recovery › marks non-current crashed tab in the tab list @mcp-ubuntu-latest-chrome

5232 passed, 631 skipped


Merge workflow run.

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor Author

🟢 All three MCP failures predate this PR

Hi, I'm the Playwright bot. I checked the MCP failures; none was caused by this PR.

Evidence

Checked MCP run 43961721716 at 457736bbb5f8c8d5666731e9757019b24817f77b.

Pre-existing crash-recovery failures

All three [chrome] tests in tests/mcp/crash.spec.ts fail identically in the earlier main job, on the PR's base commit 826ce42b8664ea940424e77ce51f1cdf96dcd37f:

  • :31 › reports the navigation error, then resets and logs the crash — 30-second timeout at line 48 while checking recovery.
  • :58 › lists only one tab — 30-second timeout and Not connected at line 71.
  • :79 › marks non-current crashed tab in the tab list — 30-second timeout and Not connected at line 93.

The PR changes only JSON fulfillment content-type selection and its page test. These crash tests navigate to chrome://crash and check recovery and tab state; they do not fulfill JSON routes. The matching failures on the unchanged base confirm that they predate this PR, but do not establish whether they are intermittent.

The separate tests 1 failures are covered by the earlier verdict.

Checked the failures on Linux by the Playwright bot - agent run

@dcrousso
Devin Rousso (dcrousso) marked this pull request as ready for review November 16, 2026 22:43
@yury-s
Yury Semikhatsky (yury-s) merged commit bfc459c into main Nov 18, 2026
29 of 31 checks passed
@yury-s
Yury Semikhatsky (yury-s) deleted the triage/44109/43960048500-1 branch November 18, 2026 18:31
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.

[Bug]: route.fulfill({ json }) replaces a Content-Type set in headers and sets none for null, false, 0 and ''

2 participants