fix handling same route pattern for "*" path#658
Merged
Conversation
Coverage ReportIlc/serverCommit SHA:886cd7a2c40a7a4b6392de996b26bff043a78875 Test coverage results 🧪File details
Ilc/clientCommit SHA:886cd7a2c40a7a4b6392de996b26bff043a78875 Test coverage results 🧪File details
RegistryCommit SHA:886cd7a2c40a7a4b6392de996b26bff043a78875 Test coverage results 🧪File details
|
stas-nc
approved these changes
Jul 29, 2025
b1ff
approved these changes
Jul 29, 2025
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
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.
Problem
The current route merging logic was incorrectly treating wildcard routes (*) with different orderPos values as the same route, causing them to be merged instead of being preserved as separate routes. This prevented developers from creating multiple wildcard routes with different ordering priorities.
Current Behavior
Routes are considered "the same" and will be merged if:
They have matching routeId values, OR
They have matching route patterns (regardless of orderPos)
This means:
A wildcard route * with orderPos: -99 would merge with another * route having orderPos: 1
Non-wildcard routes like /users with orderPos: 10 would merge with /users having orderPos: 50
Routes are matched purely on pattern, ignoring positioning
New Behavior
Routes are considered "the same" and will be merged if:
They have matching routeId values, OR
For wildcard routes (*): They have matching route pattern AND matching orderPos values
For all other routes: They have matching route patterns (orderPos ignored)
This means:
Wildcard route * with orderPos: -99 will NOT merge with * having orderPos: 1 (treated as separate routes)
Non-wildcard routes like /users with orderPos: 10 will still merge with /users having orderPos: 50
Wildcard routes now require exact orderPos matching for merging
Use Case Enabled
This change enables developers to create multiple wildcard routes with different priorities:
Scenario: Base wildcard route for common layout, plus specific wildcard routes for different sections
Original: * (orderPos: -99) provides base template and common slots
Override: * (orderPos: 1) adds header-specific functionality
Override: * (orderPos: 2) adds footer-specific functionality
Result: Three separate wildcard routes that work together in the routing cascade, instead of being incorrectly merged into one.
Impact Analysis
✅ Preserves existing behavior for non-wildcard routes
✅ Preserves existing behavior for routes with routeId
✅ Enables new functionality for wildcard routes with different orderPos