fix(solid-router): setting search params with 2 parallel navigate calls #5797
Merged
birkskyum(GitHub profile, opens in a new tab)merged 2 commits into
main fromrefs/pull/5797/head·merged by birkskyum(GitHub profile, opens in a new tab) Closes https://github.com/TanStack/router/issues/5749
Summary by CodeRabbit#
- Bug Fixes
- Improved handling of chained synchronous navigation calls to prevent state inconsistencies.
- Fixed an issue where parallel navigate calls with search parameters could cause unexpected behavior.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-router
View your CI Pipeline Execution ↗ for commit c29874d4ecc0006d3a02b3dbc53b6f7f3c33fba7
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 7m 35s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 1m 22s View ↗
☁️ Nx Cloud last updated this comment at
2025-11-09 14:53:21UTCMore templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-example-basic-supabase
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5797@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5797@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5797@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5797@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5797@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5797@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5797@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5797@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5797@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5797@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5797@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5797@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5797@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5797@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5797@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5797@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5797@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5797@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5797@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5797@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5797@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5797@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5797@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5797@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5797@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5797@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5797@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5797@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5797@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5797@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5797@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5797@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5797@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5797@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5797commit:
c29874dbirkskyum(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Walkthrough#
RouterCore now tracks a pending location state during navigation builds via the new
pendingBuiltLocationfield. ThebuildLocationmethod prioritizes this pending location over the latest committed location when determining the current location context. Microtask-based cleanup logic resets the pending state after commit initiation, enabling chained synchronous navigate calls. A previously skipped test validating parallel navigate calls with search parameters has been re-enabled with initialization synchronization.Changes#
packages/router-core/src/router.tspendingBuiltLocationfield to RouterCore; updatesbuildLocationto check pending state before latest location; modifies build-and-commit flow to set pending location, then clear via microtask after commit begins.packages/solid-router/tests/useNavigate.test.tsxscreen.findByTestId('param1')) to ensure router readiness before assertions.Sequence Diagram#
Estimated code review effort#
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs#
buildLocationto reduce allocations; overlaps with the same method modified here for pending location state handling.Suggested reviewers#
Poem#
Pre-merge checks and finishing touches#
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between cfe7ee96e939030c262befa5dc219670fcaf112f and c29874d4ecc0006d3a02b3dbc53b6f7f3c33fba7.
📒 Files selected for processing (2)
packages/router-core/src/router.ts(3 hunks)packages/solid-router/tests/useNavigate.test.tsx(2 hunks)🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/solid-router/tests/useNavigate.test.tsxpackages/router-core/src/router.tspackages/{react-router,solid-router}/**
📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/solid-router/tests/useNavigate.test.tsxpackages/router-core/**
📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/router-core/src/router.ts🧠 Learnings (6)
📓 Common learnings
📚 Learning: 2025-10-08T08:11:47.088Z
Applied to files:
packages/solid-router/tests/useNavigate.test.tsxpackages/router-core/src/router.ts📚 Learning: 2025-10-14T18:59:33.990Z
Applied to files:
packages/solid-router/tests/useNavigate.test.tsx📚 Learning: 2025-09-23T17:36:12.598Z
Applied to files:
packages/solid-router/tests/useNavigate.test.tsx📚 Learning: 2025-10-01T18:30:26.591Z
Applied to files:
packages/router-core/src/router.ts📚 Learning: 2025-09-23T17:36:12.598Z
Applied to files:
packages/router-core/src/router.ts🧬 Code graph analysis (1)
packages/router-core/src/router.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (4)
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