-
-
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(rerouting): check that the new route is different #8648
Conversation
🦋 Changeset detectedLatest commit: f522ad2 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Code looks good to me. I wonder if we can add a test case, the same we have in the issue
Let's put a potential endless loop in our CI 🥳 |
@@ -220,6 +220,7 @@ export async function handleRoute({ | |||
let response = await pipeline.renderRoute(renderContext, mod); | |||
if (response.status === 404 && has404Route(manifestData)) { | |||
const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline); | |||
// if (fourOhFourRoute?.route !== options.route) |
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.
Commenting out the fix to see what happens to CI.
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.
CI times out. Logs for astro:test
never appear. It wouldn't be possible to tell if the cases failed.
Shouldn't Astro catch these loops? 🤔 |
They seem to be synchronous, so there's not stopping them. |
Well, let's not overthink it then. You tested manually :) |
And we don't have the bug in our codebase anymore! 🥳 at least this particular instance of it |
Changes
Response(null, { status: 404 })
from middleware makesastro dev
hang #8257Testing
Added 4 cases based on what I saw people encounter in the issue and on discord.
Docs
Does not affect usage.