-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(remix-server-runtime): use correct error/catch boundary on SSR action errors #3436
Conversation
"CatchBoundary" | ||
); | ||
).slice(0, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to slice
and then look for the boundary, otherwise we miss leaf boundaries. Instead, find the boundary then slice
so we don't run the loader for the boundary route.
@@ -880,7 +880,8 @@ describe("shared server runtime", () => { | |||
let result = await handler(request); | |||
expect(result.status).toBe(400); | |||
expect(testAction.mock.calls.length).toBe(1); | |||
expect(rootLoader.mock.calls.length).toBe(1); | |||
// Should not call root loader since it is the boundary route | |||
expect(rootLoader.mock.calls.length).toBe(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These unit tests were previously invalid - if we throw from the child and it gets handled by the root - we do not want to re-run the root loader
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Closes: #599
Testing Strategy: I tested using the repo in #599 but the repro setup is basically:
ErrorBoundary
orCatchBoundary
form
or<Form reloadDocument={true}>
submitting to child action that throws