-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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/9.0-staging] Fix IsOSVersionAtLeast
when build or revision are not provided
#109332
base: release/9.0-staging
Are you sure you want to change the base?
[release/9.0-staging] Fix IsOSVersionAtLeast
when build or revision are not provided
#109332
Conversation
…Version.MacCatalyst.cs Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
…m.cs Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…m.cs Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…m.cs Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
…m.cs Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me for servicing.
This fix targets only the IsOSVersionAtLeast
so that it returns the expected value when a version.Build
or version.Revision
contains a value less than 0. That is different from the original fix in #108748 where the OperatingSystem
instance itself is normalized to have 0
for those properties.
@artl93 This is ready for Servicing now |
Thanks! I'd like, to get clearer on the customer scenario for my education. What does the app see right now? Is the problem that version checks apps do to, for example, make their code selectable based on versions of macOS work properly? How long has MacCatalyst worked this way? |
This issue doesn’t make the code selectable based on different versions but leads to incorrect behavior. For example, on MacCatalyst, if the version is set to
We have no evidence that |
Backport of #108748 to release/9.0-staging
/cc @kotlarmilos
Customer Impact
This PR fixes #108694 by updating
IsOSVersionAtLeast
to treat unspecified build or revision components as zero. Previously, theIsOSVersionAtLeast
didn't normalize components, leading to incorrect version checks on MacCatalyst when only two components (major and minor) were provided.Regression
On MacCatalyst, the version does not include build or revision components, and tests only covered the four-parameter overload of
IsOSVersionAtLeast
.Testing
The
OperatingSystem
tests have been extended to cover the three- and two-parameter overloads ofIsOSVersionAtLeast
.Risk
Low. Only MacCatalyst should be affected, as it is the only platform that does not provide a build component. Also, this change does not introduce a breaking change.