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

Windows version classes: return "Windows 11 unknown" if running on 10.0.22000 or later and the build is unknown to NVDA #15992

Closed
josephsl opened this issue Jan 1, 2024 · 0 comments · Fixed by #15993
Labels
p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@josephsl
Copy link
Collaborator

josephsl commented Jan 1, 2024

Hi,

Closing a gap with unknown Windows release detection and to serve as a testbed for structural pattern matching:

Is your feature request related to a problem? Please describe.

Currently, when instantiating Windows version object (winVersion.WinVersion), passing an unknown build (Insider Preview and other unreleased builds) will casue NVDA to say "Windows 10 unknown" when in fact the build could be a Windows 11 build (such as build 22635 which is current beta channel build as of time of this post). For example, using winVersion.WinVersion(major=10, minor=0, build=26021) (which I assume is the latest build compiled inside Microsoft) would be seen as "Windows 10 unknown" when in fact this is a potential Windows Insider canary build (Widnows 11 build range).

Describe the solution you'd like

Return "Windows 11 unknown" if running on 10.0.22000 or later and an unknown build is passed to winVersion.WinVersion constructor. The solution would involve structural pattern matching for future proofing purposes and would follow the below algorithm:

match major.minor:

  • 6.3: Windows 8.1
  • 10.0 and a known build is passed in: return the release name recognied by NVDA
  • 10.0 with unknown build >= 22000: Windows 11 unknown
  • 10.0: Windows 10
  • Everything else: unknown release

Notice the case order: structural pattern matching tests cases (including guards) from top to bottom, thus checking for known releases and build range early is crucial.

Describe alternatives you've considered

Leave code as is, or if implementing changes, use ternary operation to specify build ranges and default release name at the cost of scaled down future proofing.

Additional context

I mention future proofing because of Windows release plans in 2024 (Windows 11 24H2/LTSC/12 (tentative) or whatever Microsoft announces in a few months) provided that the kernel version remains 10.0.

Thanks.

josephsl added a commit to josephsl/nvda that referenced this issue Jan 1, 2024
… unknown'. Re nvaccess#15992.

Use structural pattern matching (match/case) when filling out Windows release names. For unknown builds above 10.0.22000, the  uild is named 'Windows 11 unknoww'. The overall structural patern matching proceeds as follows:

match (major, minor):
* 6.3: Windows 8.1
* 10.0 and is a known build: retrieve release name from the private builds to release names map
* 10.0 with unkonwn build >= 22000: Windows 11 unknown
* 10.0: Windows 10 unknown
* Everything else: Windows unknown release
josephsl added a commit to josephsl/nvda that referenced this issue Jan 1, 2024
Modernize type hints:
* typing.Optional: type | None
* typin.Dict: just use 'dict'
josephsl added a commit to josephsl/nvda that referenced this issue Jan 1, 2024
…own' test. Re nvaccess#15992.

To test 'Windows 11 unknown' release name, use 10.0.25398 (Windows 11 Zinc/Server 23H2 (annual container release)) which is unkonwn to NVDA.
@seanbudd seanbudd added p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Jan 1, 2024
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Jan 2, 2024
seanbudd pushed a commit that referenced this issue Jan 2, 2024
…d above 10.0.22000 is seen when instantiating (#15993)

Closes #15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
Nael-Sayegh pushed a commit to Nael-Sayegh/nvda that referenced this issue Feb 15, 2024
…d above 10.0.22000 is seen when instantiating (nvaccess#15993)

Closes nvaccess#15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
SaschaCowley pushed a commit to SaschaCowley/nvda that referenced this issue Feb 27, 2024
…d above 10.0.22000 is seen when instantiating (nvaccess#15993)

Closes nvaccess#15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
Adriani90 pushed a commit to Adriani90/nvda that referenced this issue Mar 13, 2024
…d above 10.0.22000 is seen when instantiating (nvaccess#15993)

Closes nvaccess#15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
3 participants