Repository navigation
Conversation
simahawk
force-pushed
the
18-imp-endpoint_route_handler-route-conflicts
branch
2 times, most recently
from
October 16, 2026 13:44
6f368bd to
e39a9bd
Compare
Contributor
Author
|
@TDu ping :) |
Contributor
Author
|
@lmignon may ask you to have a look at this one? |
simahawk
force-pushed
the
18-imp-endpoint_route_handler-route-conflicts
branch
from
October 20, 2026 13:54
e39a9bd to
f45dfea
Compare
lmignon
reviewed
Oct 20, 2026
lmignon
reviewed
Oct 20, 2026
lmignon
left a comment
There was a problem hiding this comment.
A little change to improve readability ...
simahawk
force-pushed
the
18-imp-endpoint_route_handler-route-conflicts
branch
from
October 20, 2026 17:09
f45dfea to
7bbf4ba
Compare
lmignon
reviewed
Oct 21, 2026
When the routing map is built, check each custom route (stored or generated) against the routes already loaded: standard controllers and other custom routes. A route w/ the same URL and overlapping methods (no methods = any) was silently shadowed (werkzeug matches the first rule only). Now it's skipped and an error is logged w/ both owners. The same URL w/ different methods is still fine.
`endpoint_hash` was computed w/ the builtin `hash()`, which is randomized per process for strings: the same route got a different hash after a restart, so `unique(endpoint_hash)` only caught duplicates computed in the same process. Use a md5 of the routing impacting values instead (`utils.stable_hash`). The migration (end of the update, once all modules are loaded) forcedly registers again the routes in sync of all the consumer models: rows are dropped and created w/ the new hash. Records not in sync w/ the registry get their new hash when they are synced. Consumer models now include indirect ones (eg: `endpoint.endpoint` via `endpoint.mixin`, `edi.endpoint`): they were missing, hence routes were not checked for uniqueness across them either.
simahawk
force-pushed
the
18-imp-endpoint_route_handler-route-conflicts
branch
from
October 21, 2026 07:14
7bbf4ba to
648b2fc
Compare
lmignon
approved these changes
Oct 21, 2026
TDu
approved these changes
Oct 27, 2026
Contributor
|
This PR has the |
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.
Follow-up of #176 (comment)
Detect route conflicts
When the routing map is built, each custom route (stored or generated) is checked against the routes already loaded: standard controllers and other custom routes.
A route w/ the same URL and overlapping methods (no methods = any) was silently shadowed (werkzeug matches the first rule only).
Now it's skipped and an error is logged w/ both owners. The same URL w/ different methods is still fine.
utils.RouteConflictTracker(one dict lookup per route, ~3 ms for ~800 rules)ir.http._endpoint_routing_rulesnow yields(endpoint rule, url, endpoint)Stable endpoint hash
endpoint_hashwas computed w/ the builtinhash(), randomized per process for strings:unique(endpoint_hash)only caught duplicates computed in the same process.utils.stable_hash)endpoint.endpoint,edi.endpoint): routes were not checked for uniqueness across them