Skip to content
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: skip already seen routes after a match #196

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

ydylla
Copy link
Collaborator

@ydylla ydylla commented Jun 2, 2024

This is done to be backwards compatible with the old matching behavior see #192 (comment)

This is done to be backwards compatible with the old matching behavior see #192 (comment)
@ydylla ydylla force-pushed the fix-route-order branch from 67d7ad4 to 8be826f Compare June 3, 2024 09:38
@ydylla
Copy link
Collaborator Author

ydylla commented Jun 3, 2024

Sorry for the force pushs. I added

// Only skip once after a match, so it behaves like we continued after the match.
lastMatchedRouteIdx = -1

and moved the lastMatchedRouteIdx = i line to a better place.
It gets increasingly difficult to keep all situations in mind for this function.

@ydylla ydylla requested a review from mholt June 3, 2024 09:42
Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. Indeed, routes should be invoked sequentially, in step with their matchers; so matching doesn't restart the chain.

Hopefully that's as complex as it has to get! 😅

@mholt mholt merged commit ce9789f into master Jun 4, 2024
6 checks passed
@mholt mholt deleted the fix-route-order branch June 4, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants