-
Notifications
You must be signed in to change notification settings - Fork 292
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
When a route matches multiple handlers, make it FIFO. #115
Comments
I met, too. This is very important. |
I met, too. This is very important. :) |
I think the matcher should not be dependent on the order but how many paths the url matches. #120 improves matching algorithm. So |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's imagine the handlers
If I pass the route
app://services/github
, then only handler n°3 will be triggered.But if I pass the route
app://services/defaultService
, technically handlers n°1 and n°3 should trigger.And it's where the problem starts: Because URLNavigator relies on a dictionary to save all the handlers, there is no order guaranteed.
I suggest to implement an OrderedDictionary to save all the handlers and to follow a FIFO logic for the matchers.
Here is an example of an ordered dictionary: https://gist.github.com/BabyAzerty/2efda8bcef7a4286b5dc62770ea5aab5
It wouldn't change any URLNavigator code beside the declaration of the handlers to:
The text was updated successfully, but these errors were encountered: