Skip to content

fix(router-core): skip lifecycle callbacks below fallback boundaries - #8165

Open
Sheraff wants to merge 1 commit into
fix/retain-not-found-boundaryfrom
fix/skip-descendant-lifecycle-boundaries
Open

fix(router-core): skip lifecycle callbacks below fallback boundaries#8165
Sheraff wants to merge 1 commit into
fix/retain-not-found-boundaryfrom
fix/skip-descendant-lifecycle-boundaries

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • stop lifecycle traversal at error and not-found boundaries so structural descendants that cannot render do not receive callbacks
  • keep the error or not-found boundary itself eligible for its lifecycle callback
  • add regression coverage for a descendant below a not-found boundary

Testing

Not run per request.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 014d4028-b495-4780-b9c1-74b6b280f490

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 25, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 7963ad6

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 13m 37s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 54s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-25 07:59:59 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: b60d9f0453b4
  • Measured at: 2026-08-25T07:47:26.185Z
  • Baseline source: history:9f8990b51503
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Initial (gzip) Raw Brotli Trend
react-router.minimal 83.8 KiB
+29 B
83.7 KiB
+30 B
262.7 KiB
+284 B
72.9 KiB
-65 B
▆▆▅███▁▁▂▂▂▅
react-router.full 87.3 KiB
+33 B
87.2 KiB
+32 B
274.5 KiB
+284 B
76.1 KiB
+175 B
██▅███▁▁▂▂▂▆
solid-router.minimal 33.2 KiB
+31 B
33.0 KiB
+31 B
96.6 KiB
+284 B
30.0 KiB
+80 B
▇▇▇███▁▁▁▁▁▅
solid-router.full 38.0 KiB
+26 B
37.9 KiB
+27 B
111.2 KiB
+284 B
34.2 KiB
+41 B
██▆▇▇▇▁▁▂▂▂▄
vue-router.minimal 49.5 KiB
+33 B
49.4 KiB
+34 B
138.6 KiB
+284 B
44.7 KiB
+76 B
██▆███▁▁▂▂▂▅
vue-router.full 55.1 KiB
+34 B
55.0 KiB
+33 B
156.8 KiB
+284 B
49.7 KiB
+138 B
██▅▇▇▇▁▁▂▂▂▇
react-start.minimal 96.7 KiB
+30 B
96.6 KiB
+30 B
305.0 KiB
+284 B
83.8 KiB
+15 B
▆▆▃███▁▁▃▃▃█
react-start.deferred-hydration 97.5 KiB
+29 B
96.6 KiB
+31 B
306.4 KiB
+284 B
84.5 KiB
+38 B
▆▆▄███▁▁▂▂▂▇
react-start.full 99.9 KiB
+28 B
99.8 KiB
+28 B
314.7 KiB
+284 B
86.5 KiB
-69 B
▅▅▃███▁▁▂▂▂▆
react-start.rsbuild.minimal 100.0 KiB
+30 B
99.9 KiB
+30 B
315.3 KiB
+284 B
86.4 KiB
+81 B
██▄▆▆▆▁▁▁▁▁▄
react-start.rsbuild.minimal-iife 100.4 KiB
+30 B
100.3 KiB
+30 B
316.3 KiB
+284 B
86.6 KiB
-49 B
██▄▆▆▆▁▁▁▁▁▄
react-start.rsbuild.full 103.4 KiB
+27 B
103.2 KiB
+27 B
325.4 KiB
+284 B
89.1 KiB
+61 B
██▅▆▆▆▁▁▁▁▁▄
solid-start.minimal 46.0 KiB
+30 B
45.9 KiB
+30 B
137.7 KiB
+284 B
41.0 KiB
+26 B
██▅███▁▁▁▁▁▅
solid-start.deferred-hydration 49.1 KiB
+36 B
46.0 KiB
+36 B
145.2 KiB
+284 B
43.7 KiB
+35 B
▇▇▃███▁▁▂▂▂▇
solid-start.full 51.1 KiB
+28 B
51.0 KiB
+31 B
153.1 KiB
+284 B
45.4 KiB
+60 B
▆▆▅███▁▁▁▁▁▅
vue-start.minimal 65.7 KiB
+38 B
65.6 KiB
+39 B
189.5 KiB
+284 B
58.4 KiB
+25 B
██▅███▁▁▃▃▃█
vue-start.full 69.5 KiB
+29 B
69.4 KiB
+30 B
201.8 KiB
+284 B
61.7 KiB
+27 B
██▅███▁▁▃▃▃▇

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 7963ad6

@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 1.1%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 9 improved benchmarks
❌ 8 regressed benchmarks
✅ 163 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem server error-paths redirect (vue) 473 KB 961.8 KB -50.82%
Simulation client-control-flow navigation loop (react) 160.6 ms 173.1 ms -7.25%
Simulation client-nested-params navigation loop (react) 212.1 ms 228.4 ms -7.13%
Memory mem server error-paths not-found (solid) 595.2 KB 639.3 KB -6.89%
Memory mem server error-paths redirect (react) 300.7 KB 316 KB -4.86%
Memory mem server server-fn-churn (solid) 323.4 KB 336.8 KB -3.99%
Memory mem server peak-large-page (react) 1.1 MB 1.2 MB -3.76%
Memory mem server error-paths unmatched (react) 433 KB 447.7 KB -3.29%
Memory mem server serialization-payload (solid) 7 MB 4.6 MB +52.42%
Memory mem server error-paths error (solid) 1,084.5 KB 964.2 KB +12.48%
Memory mem server peak-large-page (vue) 1.1 MB 1 MB +7.27%
Memory mem client navigation-churn (solid) 622.1 KB 584.1 KB +6.5%
Memory mem server peak-large-page (solid) 1.2 MB 1.1 MB +5.77%
Memory mem client navigation-churn (vue) 1.7 MB 1.6 MB +5.72%
Memory mem server error-paths unmatched (solid) 584.8 KB 559.8 KB +4.45%
Memory mem server error-paths not-found (vue) 506.7 KB 486.5 KB +4.16%
Memory mem server server-fn-churn (react) 399.7 KB 385.3 KB +3.75%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/skip-descendant-lifecycle-boundaries (7963ad6) with fix/retain-not-found-boundary (2b710ba)

Open in CodSpeed

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud is proposing a fix for your failed CI:

We update the keeps a hidden child matched without projecting it below a parent error test assertion to align with the PR's intended behavior change: descendants below an error/not-found boundary should no longer receive onEnter callbacks. The previous assertion (toHaveBeenCalledTimes(1)) reflected the old traversal behavior where the loop continued through all matches regardless of boundary status; the fix changes it to not.toHaveBeenCalled() to match the new runRouteLifecycle break semantics.

Tip

We verified this fix by re-running @tanstack/router-core:test:unit.

diff --git a/packages/router-core/tests/client-lane-adversarial.test.ts b/packages/router-core/tests/client-lane-adversarial.test.ts
index bcd75475..e3552864 100644
--- a/packages/router-core/tests/client-lane-adversarial.test.ts
+++ b/packages/router-core/tests/client-lane-adversarial.test.ts
@@ -407,7 +407,7 @@ describe('adversarial client lane ownership', () => {
       error: parentError,
     })
     expect(childHead).not.toHaveBeenCalled()
-    expect(childOnEnter).toHaveBeenCalledTimes(1)
+    expect(childOnEnter).not.toHaveBeenCalled()
   })
 
   test('a redirect aborts the discarded loader generation', async () => {

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally Agah-xui7

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant