[PR #925] [MERGED] test(app-router): stabilize RSC fetch error redirects #952

Closed
opened 2026-05-06 13:11:12 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/925
Author: @NathanDrake2406
Created: 4/28/2026
Status: Merged
Merged: 4/28/2026
Merged by: @james-elicx

Base: mainHead: nathan/rsc-fetch-errors-flake


📝 Commits (1)

  • 5818d03 test(app-router): stabilize RSC fetch error redirects

📊 Changes

4 files changed (+62 additions, -34 deletions)

View changed files

📝 tests/e2e/app-router/rsc-fetch-errors.spec.ts (+35 -34)
📝 tests/fixtures/app-basic/app/page.tsx (+10 -0)
tests/fixtures/app-basic/app/rsc-fetch-error-target/page.tsx (+3 -0)
📝 tests/fixtures/app-basic/middleware.ts (+14 -0)

📄 Description

What this changes

Stabilizes the App Router RSC fetch error E2E coverage by driving the navigation cases through real fixture links and a server-backed redirect-to-500 RSC chain.

Fixes #901.

Why

The flaky test depended on direct calls to the private __VINEXT_RSC_NAVIGATE__ global and a Playwright-mocked 307 chain. Under CI timing and Playwright behavior changes, the test could miss the intended follow-up .rsc request or call navigation before router state had committed.

Approach

The fixture now exposes prefetch-disabled links for the missing-route and redirect-chain cases. Middleware handles RSC requests for /rsc-fetch-redirect-src by returning a 307 to /rsc-fetch-error-target.rsc, then returns a 500 HTML response for that RSC target. The spec observes those real network responses and asserts the browser hard-navigates to the post-redirect HTML page without flashing the source URL.

Validation

  • vp check tests/e2e/app-router/rsc-fetch-errors.spec.ts tests/fixtures/app-basic/middleware.ts tests/fixtures/app-basic/app/page.tsx tests/fixtures/app-basic/app/rsc-fetch-error-target/page.tsx
  • git diff --check
  • CI=1 PLAYWRIGHT_PROJECT=app-router vp run test:e2e tests/e2e/app-router/rsc-fetch-errors.spec.ts --repeat-each=5

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/925 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 4/28/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `nathan/rsc-fetch-errors-flake` --- ### 📝 Commits (1) - [`5818d03`](https://github.com/cloudflare/vinext/commit/5818d037777b974fc73e0fa78a81493f5181058a) test(app-router): stabilize RSC fetch error redirects ### 📊 Changes **4 files changed** (+62 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `tests/e2e/app-router/rsc-fetch-errors.spec.ts` (+35 -34) 📝 `tests/fixtures/app-basic/app/page.tsx` (+10 -0) ➕ `tests/fixtures/app-basic/app/rsc-fetch-error-target/page.tsx` (+3 -0) 📝 `tests/fixtures/app-basic/middleware.ts` (+14 -0) </details> ### 📄 Description ## What this changes Stabilizes the App Router RSC fetch error E2E coverage by driving the navigation cases through real fixture links and a server-backed redirect-to-500 RSC chain. Fixes #901. ## Why The flaky test depended on direct calls to the private `__VINEXT_RSC_NAVIGATE__` global and a Playwright-mocked 307 chain. Under CI timing and Playwright behavior changes, the test could miss the intended follow-up `.rsc` request or call navigation before router state had committed. ## Approach The fixture now exposes prefetch-disabled links for the missing-route and redirect-chain cases. Middleware handles RSC requests for `/rsc-fetch-redirect-src` by returning a 307 to `/rsc-fetch-error-target.rsc`, then returns a 500 HTML response for that RSC target. The spec observes those real network responses and asserts the browser hard-navigates to the post-redirect HTML page without flashing the source URL. ## Validation - `vp check tests/e2e/app-router/rsc-fetch-errors.spec.ts tests/fixtures/app-basic/middleware.ts tests/fixtures/app-basic/app/page.tsx tests/fixtures/app-basic/app/rsc-fetch-error-target/page.tsx` - `git diff --check` - `CI=1 PLAYWRIGHT_PROJECT=app-router vp run test:e2e tests/e2e/app-router/rsc-fetch-errors.spec.ts --repeat-each=5` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:12 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#952
No description provided.