-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: fix Rest Parameters of react-router-ssr-query
#5379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix Rest Parameters of react-router-ssr-query
#5379
Conversation
WalkthroughUpdated SSR query error handlers to accept variadic parameters and forward all received arguments to original onError callbacks, without changing redirect handling or public APIs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client Code
participant MQ as MutationCache
participant QQ as QueryCache
participant SSR as SSR Handler
participant OG as Original onError
rect rgb(245,248,255)
note over MQ,SSR: Mutation error flow (updated arg forwarding)
C->>MQ: mutation error occurs
MQ->>SSR: onError(...args)
alt is redirect
SSR-->>C: trigger redirect
else not redirect
SSR->>OG: onError(...args)
OG-->>SSR: return
end
end
rect rgb(245,255,245)
note over QQ,SSR: Query error flow (updated arg forwarding)
C->>QQ: query error occurs
QQ->>SSR: onError(...args)
alt is redirect
SSR-->>C: trigger redirect
else not redirect
SSR->>OG: onError(...args)
OG-->>SSR: return
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
View your CI Pipeline Execution ↗ for commit 241100b
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/nitro-v2-vite-plugin
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
react-router-ssr-query
react-router-ssr-query
react-router-ssr-query
react-router-ssr-query
Tanstack Query recently updated (5.89.0) to pass another parameter to its
onError
callbacks, which wasn't being forwarded on correctly when using this package. It was capturing and forwarding them on one-by-one (omitting the new one). Now, it just captures the error parameter and spreads the rest. This will future-proof it if any more parameters are added or the order changes (assuming error is always the first one).Summary by CodeRabbit
Bug Fixes
Refactor