-
Notifications
You must be signed in to change notification settings - Fork 53
Add way to interrupt response handling for client side navigation. #603
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying redwood-sdk-docs with
|
| Latest commit: |
45cf1d0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://08dde8ec.redwood-sdk-docs.pages.dev |
| Branch Preview URL: | https://pp-handle-error-responses.redwood-sdk-docs.pages.dev |
|
Hey @justinvdm , one of the issues that I have is that I don't know how to make this work for real-time. Could you maybe explain to me how we deal with non-200 responses in real-time? |
This was referenced Jul 17, 2025
|
I've got it working, want to test it more thoroughly later today before merging and releasing, but looks like its working. If you'd like to try it:
|
justinvdm
added a commit
that referenced
this pull request
Aug 18, 2025
We introduced the awesome `response.headers` in #603, but we have not yet updated starters and docs to use it.
justinvdm
added a commit
that referenced
this pull request
Aug 18, 2025
We introduced the awesome `response.headers` in #603, but we have not yet updated starters and docs to use it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When client-side navigation is initialized, we use fetch to request a new RFC payload. This RSC payload can also be an invalid response.
In which case, client-side navigation breaks. This PR includes the ability to manually handle the response and determine whether it's an error, and then to just forward the browser directly to that page so that the user gets the proper experience.
edit(justinvdm, 22 Jul 2025):
This PR also now includes the changes needed to get this same functionality to work with the realtime: interruptors + client navigation + realtime client:
The main changes on the realtime side:
ACTION_*messages (when a client triggers an action and we're getting the corresponding response) andRSC_*messages (when server sends up an update - e.g. as a result of a different client's triggering an action) now reuse logic where possiblepackMessage+unpackMessage+ types for protocol messagesResponses over websocket on client side - without refactoring this turned out to be surprisingly difficultACTION_*andRSC_*messages, allow for short-circuiting processing of responses usinghandleResponses- to integrate with client navigationFixes #601