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

[.NET 6] UriBuilder breaking change not documented #61363

Closed
filipnavara opened this issue Nov 9, 2021 · 8 comments
Closed

[.NET 6] UriBuilder breaking change not documented #61363

filipnavara opened this issue Nov 9, 2021 · 8 comments
Labels
area-System.Net documentation Documentation bug or enhancement, does not impact product or test code
Milestone

Comments

@filipnavara
Copy link
Member

Consider the following code:

Console.WriteLine(new UriBuilder("msg", "dummy", 0, "segment").Uri);

On .NET 5 the output is msg://dummy/segment. On .NET 6 the output is msg://dummy:0/segment. It is possible to change the port number to -1 to get the same result. This is not listed in the documented breaking changes. If it was intentional it should be added in there.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 9, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@marek-safar
Copy link
Contributor

/cc @karelz

@karelz
Copy link
Member

karelz commented Nov 9, 2021

@MihaZupan any thoughts?

@ghost
Copy link

ghost commented Nov 9, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Consider the following code:

Console.WriteLine(new UriBuilder("msg", "dummy", 0, "segment").Uri);

On .NET 5 the output is msg://dummy/segment. On .NET 6 the output is msg://dummy:0/segment. It is possible to change the port number to -1 to get the same result. This is not listed in the documented breaking changes. If it was intentional it should be added in there.

Author: filipnavara
Assignees: -
Labels:

area-System.Net, untriaged

Milestone: -

@karelz karelz added the bug label Nov 9, 2021
@MihaZupan
Copy link
Member

Introduced by #40986 which was a bug fix for #37865 (comment).
As documented by UriBuilder.Port, -1 should be used to get the default port.

You were relying on an undocumented bug affecting unknown Uri schemes. For example if you use http instead of msg, you will see that the port is present in both 5.0 and 6.0.

The is not specific to UriBuilder, and we may choose to document it as a breaking change.

@MihaZupan MihaZupan added needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet untriaged New issue has not been triaged by the area owner and removed untriaged New issue has not been triaged by the area owner bug labels Nov 9, 2021
@karelz
Copy link
Member

karelz commented Nov 9, 2021

It seems to fall into the "technical breaking change" category -- it was misbehaving against docs and we fixed it.
Given that it is fairly corner case, I would recommend to close the issue until we see at least couple of more customers hitting it. If more folks hit it, we should document it as breaking change. Otherwise this issue + docs may be sufficient IMO.

@filipnavara
Copy link
Member Author

Thanks for the analysis! I expected that the change was intentional but it was a bit tricky to find what what going on (the bug didn't manifest anywhere close to the UriBuilder usage). I filed a ticket because it was not listed in the breaking changes and I thought that people may run into it.

@karelz
Copy link
Member

karelz commented Nov 16, 2021

Triage: Closing as per above explantion - #61363 (comment)
We will document it if more customers hit it. Please reply here, or file new issue referencing this one if you are in that category.

@karelz karelz closed this as completed Nov 16, 2021
@karelz karelz removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Nov 16, 2021
@karelz karelz added this to the 7.0.0 milestone Nov 16, 2021
@karelz karelz added documentation Documentation bug or enhancement, does not impact product or test code and removed untriaged New issue has not been triaged by the area owner labels Nov 16, 2021
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net documentation Documentation bug or enhancement, does not impact product or test code
Projects
None yet
Development

No branches or pull requests

4 participants