Skip to content

test(start): cover ssr false hydration redirect - #7965

Merged
Sheraff merged 1 commit into
mainfrom
codex/issue-7947-regression-test
Aug 5, 2026
Merged

test(start): cover ssr false hydration redirect#7965
Sheraff merged 1 commit into
mainfrom
codex/issue-7947-regression-test

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why

Issue #7947 could redirect from the initial route before React committed hydration. React would then hydrate the destination tree against the origin route's HTML and report hydration error #418.

The recent lane-loader rewrite prevents the race, but it did not include focused regression coverage. This test protects that user-visible behavior using only public router APIs.

Test plan

  • CI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-selective-ssr:test:e2e --outputStyle=stream --skipRemoteCache — 11 passed
  • repeated the issue-7947 test five times on current main — 5 passed
  • applied the same test to commit b5e540d74a from August 3 — fails with React error SPA login system with only protected routes #418 as expected
  • pnpm test:eslint, pnpm test:types, and pnpm test:unit — no affected non-e2e targets

Summary by CodeRabbit

  • New Features

    • Added /issue-7947 and /issue-7947-target routes with custom page metadata.
    • Added redirect handling from the issue route to its target page.
  • Bug Fixes

    • Improved behavior for routes rendered without server-side rendering, preventing hydration-related browser errors during redirects.
  • Tests

    • Added end-to-end coverage verifying the redirect and target page load successfully.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f2f15cd-041b-4aee-841f-00c106112329

📥 Commits

Reviewing files that changed from the base of the PR and between b2908c6 and d8e944c.

📒 Files selected for processing (4)
  • e2e/react-start/selective-ssr/src/routeTree.gen.ts
  • e2e/react-start/selective-ssr/src/routes/issue-7947-target.tsx
  • e2e/react-start/selective-ssr/src/routes/issue-7947.tsx
  • e2e/react-start/selective-ssr/tests/app.spec.ts

📝 Walkthrough

Walkthrough

Changes

Selective SSR redirect regression

Layer / File(s) Summary
SSR-disabled redirect routes
e2e/react-start/selective-ssr/src/routes/issue-7947.tsx, e2e/react-start/selective-ssr/src/routes/issue-7947-target.tsx
Adds the origin and target routes with SSR disabled, metadata, redirect behavior, and test markers.
Generated route-tree registration
e2e/react-start/selective-ssr/src/routeTree.gen.ts
Registers both routes as root-level routes and updates generated route and path type mappings.
Redirect and hydration regression test
e2e/react-start/selective-ssr/tests/app.spec.ts
Verifies the redirect, target rendering, and absence of hydration-related browser errors.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • TanStack/router issue 7947 — Directly covers the SSR-disabled beforeLoad redirect hydration bug tested by this change.

Possibly related PRs

  • TanStack/router#7805 — Reworks the SSR, pending, and redirect lifecycle related to this regression test.

Suggested labels: package: react-start-client

Suggested reviewers: schiller-manuel

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant PlaywrightTest
  participant Router
  participant Issue7947Route
  participant Issue7947TargetRoute
  PlaywrightTest->>Browser: Navigate to /issue-7947
  Browser->>Router: Request origin route
  Router->>Issue7947Route: Run beforeLoad
  Issue7947Route->>Router: Redirect to /issue-7947-target
  Router->>Issue7947TargetRoute: Load target route
  Issue7947TargetRoute->>Browser: Render target marker
  PlaywrightTest->>Browser: Check URL, marker, and browser errors
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the added test coverage for an ssr: false hydration redirect regression.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-7947-regression-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit d8e944c

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m View ↗
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 2m 43s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-05 17:28:39 UTC

@Sheraff
Sheraff marked this pull request as ready for review August 5, 2026 17:24
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

5 package(s) bumped directly, 18 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/router-core 1.171.16 → 1.171.17 Changeset
@tanstack/start-client-core 1.170.15 → 1.170.16 Changeset
@tanstack/start-plugin-core 1.171.27 → 1.171.28 Changeset
@tanstack/start-server-core 1.169.19 → 1.169.20 Changeset
@tanstack/start-static-server-functions 1.167.20 → 1.167.21 Changeset
@tanstack/react-router 1.170.19 → 1.170.20 Dependent
@tanstack/react-start 1.168.36 → 1.168.37 Dependent
@tanstack/react-start-client 1.168.17 → 1.168.18 Dependent
@tanstack/react-start-rsc 0.1.35 → 0.1.36 Dependent
@tanstack/react-start-server 1.167.24 → 1.167.25 Dependent
@tanstack/router-cli 1.167.22 → 1.167.23 Dependent
@tanstack/router-generator 1.167.22 → 1.167.23 Dependent
@tanstack/router-plugin 1.168.24 → 1.168.25 Dependent
@tanstack/router-vite-plugin 1.167.24 → 1.167.25 Dependent
@tanstack/solid-router 1.170.19 → 1.170.20 Dependent
@tanstack/solid-start 1.168.35 → 1.168.36 Dependent
@tanstack/solid-start-client 1.168.17 → 1.168.18 Dependent
@tanstack/solid-start-server 1.167.24 → 1.167.25 Dependent
@tanstack/start-storage-context 1.167.18 → 1.167.19 Dependent
@tanstack/vue-router 1.170.18 → 1.170.19 Dependent
@tanstack/vue-start 1.168.34 → 1.168.35 Dependent
@tanstack/vue-start-client 1.167.20 → 1.167.21 Dependent
@tanstack/vue-start-server 1.167.24 → 1.167.25 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7965

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7965

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7965

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7965

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7965

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7965

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7965

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7965

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7965

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7965

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7965

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7965

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7965

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7965

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7965

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7965

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7965

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7965

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7965

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7965

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7965

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7965

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7965

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7965

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7965

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7965

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7965

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7965

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7965

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7965

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7965

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7965

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7965

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7965

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7965

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7965

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7965

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7965

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7965

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7965

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7965

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7965

commit: d8e944c

@Sheraff
Sheraff merged commit 60163bf into main Aug 5, 2026
10 checks passed
@Sheraff
Sheraff deleted the codex/issue-7947-regression-test branch August 5, 2026 17:33
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