-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Link generation behaviour change: page to controller in area #4212
Comments
I worked with James on tracking this down. We expected this behavior to change in 2.2 but due to a bug it didn't. I asked James to open an issue so that we could use it to consider the issue and try to figure out whether users will be impacted by this. It's possible for us to restore the 2.2 behavior if necessary but will require significant work. |
@JamesNK, what else is pending here? We're trying to wrap up preview2 issues within couple of days. |
If this is not super critical, and work is pending, please move to preview3 |
This change enhances our ambient value logic to also deal with required values. In 2.2 we introduced a 'required values' semantic to allow route values to appear "to the left" of a route pattern for the purpose of ambient values copying. This is a complicated way of saying "when you like to a different endpoint then discard the ambient values". What we didn't consider is that some ambient values are special (like area). So basically, we'll allow an ambient value to be used if it's part of the required values - even if we've already decided to discard the ambient values. This is a pretty surgical fix and only affected the desired scenario based on tests. ----- I also removed an optimization that I think is broken. I put an earlier optimization in place that attempted to count ambient values as they were "seen" to try and avoid some extra copying. This copying loop has a cost even if it no-ops which is what I was trying to prevent. Unfortunately since we added 'required values' - it's now possible for an ambient value to be double-counted, which makes this optimization incorrect.
This change enhances our ambient value logic to also deal with required values. In 2.2 we introduced a 'required values' semantic to allow route values to appear "to the left" of a route pattern for the purpose of ambient values copying. This is a complicated way of saying "when you like to a different endpoint then discard the ambient values". What we didn't consider is that some ambient values are special (like area). So basically, we'll allow an ambient value to be used if it's part of the required values - even if we've already decided to discard the ambient values. This is a pretty surgical fix and only affected the desired scenario based on tests. ----- I also removed an optimization that I think is broken. I put an earlier optimization in place that attempted to count ambient values as they were "seen" to try and avoid some extra copying. This copying loop has a cost even if it no-ops which is what I was trying to prevent. Unfortunately since we added 'required values' - it's now possible for an ambient value to be double-counted, which makes this optimization incorrect.
This change in behaviour was fixed. There is no breaking change to speak of here. |
Linking from a page in an area to a controller in the same area, without specifying the area is changing.
We could make 3.0 succeed with a moderate amount of additional work. The question is whether anyone is doing this and if it is important to customers.
This issue is something to evaluate near the end of 3.0 to make a decision.
Affected test: PagesInAreas_CanGenerateLinksToControllersAndPages
PR that is changing this - aspnet/Routing#914
The text was updated successfully, but these errors were encountered: