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

[release/6.0] Fix TimeZoneInfo.HasIanaId when using Local Time Zone #58414

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Aug 31, 2021

Fixes #58326

Backport of #58392 to release/6.0

/cc @tarekgh

Customer Impact

Without this fix, users of TimeZoneInfo.HasIanaId can get wrong values when using TimeZoneInfo.Local.

We have exposed the new property TimeZoneInfo.HasIanaId in .NET 6.0. This property tells if the Time Zone object is created with IANA Id. This property returns the correct results except when using TimeZoneInfo.Local. The reason is when we initialize TimeZoneInfo.Local property we clone the object before returning it, but we missed cloning HasIanaId property inside the returned object. The fix is to ensure HasIanaId is initialized correctly in TimeZoneInfo.Local.

Testing

I tested this on Windows and Linux. Also, I have run the whole regression tests with the fix without any problem. I added more tests to cover the test gap for the functionality we are fixing here.

Risk

Is low. The fix is scoped to the HasIanaId property only which is a newly exposed property in .NET 6.0. The change is well tested and added more tests too.

@ghost
Copy link

ghost commented Aug 31, 2021

Tagging subscribers to this area: @tarekgh, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #58326

Backport of #58392 to release/6.0

/cc @tarekgh

Customer Impact

Without this fix, users of TimeZoneInfo.HasIanaId can get wrong values when using TimeZoneInfo.Local.

We have exposed the new property TimeZoneInfo.HasIanaId in .NET 6.0. This property tells if the Time Zone object is created with IANA Id. This property returns the correct results except when using TimeZoneInfo.Local. The reason is when we initialize TimeZoneInfo.Local property we clone the object before returning it, but we missed cloning HasIanaId property inside the returned object. The fix is to ensure HasIanaId is initialized correctly in TimeZoneInfo.Local.

Testing

I tested this on Windows and Linux. Also, I have run the whole regression tests with the fix without any problem. I added more tests to cover the test gap for the functionality we are fixing here.

Risk

Is low. The fix is scoped to the HasIanaId property only which is a newly exposed property in .NET 6.0. The change is well tested and added more tests too.

Author: tarekgh
Assignees: -
Labels:

area-System.Globalization

Milestone: -

@tarekgh
Copy link
Member Author

tarekgh commented Aug 31, 2021

CC @danmoseley @ericstj

@danmoseley
Copy link
Member

Approved for release/6.0. Clear defect in a new API, reported by partner, localized fix.

@tarekgh
Copy link
Member Author

tarekgh commented Aug 31, 2021

CC @eerhardt

@tarekgh
Copy link
Member Author

tarekgh commented Aug 31, 2021

CC @@roji

@tarekgh
Copy link
Member Author

tarekgh commented Aug 31, 2021

@danmoseley could you please merge this one? Thanks!

@Anipik Anipik merged commit 22b53e8 into dotnet:release/6.0 Aug 31, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants