-
Notifications
You must be signed in to change notification settings - Fork 147
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
[Theme] Fix 401 and 405 for certain routes in local dev #5329
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success2032 tests passing in 909 suites. Report generated by 🧪jest coverage report action from 8e3f962 |
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.
Thank you for this PR, @frandiox! I've left only one minor comment about the html
module :)
8e3f962
to
f22d234
Compare
@karreiro To fix the problems I had earlier, I've refactored our proxy and render logic to use the native Generally, I've tried to move away from h3 v1 utilities as much as possible. Turns out they support returning Responses in v1 as well, and I think it's their default in v2. |
/snapit |
🫰✨ Thanks @frandiox! Your snapshot has been published to npm. Test the snapshot by intalling your package globally: pnpm i -g @shopify/[email protected]
|
WHY are these changes introduced?
[HOLD] -- This currently fails when the proxy logic gets a 401 or similar because H3 has already sent headers/status and we can't overwrite them.Fixes #5103
WHAT is this pull request doing?
Certain routes can't be rendered by SFR (e.g. app routes) and we must proxy them instead. We don't know before hand all of these routes, so this PR is adding a fallback: if a rendering fails with 4xx (the observed status errors for this situation), we try to proxy it. If the proxy doesn't work, we forward the original render error.
How to test your changes?
/account/logout
with--verbose
. It should show that render failed and proxying worked./not-found-path
. It should return the rendering error after trying the proxy (see logs).Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist