-
Notifications
You must be signed in to change notification settings - Fork 8.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
Prevent crashes in Settings UI launch on OS versions before package management extensions #10238
Conversation
…default conhost is always returned as one element. Change the model to hold a nullptr DefaultTerminal model representation even if that fails because XAML is A-OK with nullptr and will select no item as Current but will crash out if it gets an exception.
Hello @miniksa! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 7 hours 49 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@msftbot wait 1 minute before merging |
Hello @miniksa! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
…anagement extensions (#10238) Prevent crashes in Settings UI launch on OS versions before package management extensions ## PR Checklist * [x] Closes #10106 * [x] I work here * [x] Manual tests passed. ## Detailed Description of the Pull Request / Additional comments - On older OS versions like 18363, some of the COM interfaces we use to look up information from the OS application package management catalog (to find default terminals) are unavailable. This returns `E_NOINTERFACE`. This then ends up returning an empty list of items and null as a selected item. - I had intended for that to not return that particular error all the way up and just log it because the console and terminal lookup functions always return at least one element: the one representing the `conhost.exe` that is already on the machine. - I have changed the "default packages" lookup to log instead of return failures like E_NOINTERFACE such that it can continue processing and make the "package" of the hardcoded `conhost.exe` default no matter what. (It will still return an error if there are somehow 0 packages because that code changed or some other catastrophic event happened...) - I have also changed the Model to have a nulled DefaultTerminal model object (as all winrt objects are nullable) instead of using an optional. I did this because XAML is perfectly happy receiving a `nullptr` for a selected item and will just not select anything. By contrast, if it has an exception occur... it will just bubble that out and crash. ## Validation Steps Performed - Simulated no items returned from list and nullptr returned to XAML on Current() method of Model. Validated XAML will happily select no item from list (and is fine with an empty list of items... that is it doesn't crash). - Simulated downlevel OS returning package management errors in lookup catalog functions after the hardcoded default is added to the list. Ensured that this error is only logged, the remainder of the package identification functions make the hardcoded default package, and it is presented as your one and only option in the XAML. (cherry picked from commit b2c2a4c)
🎉 Handy links: |
🎉 Handy links: |
Prevent crashes in Settings UI launch on OS versions before package management extensions
PR Checklist
Detailed Description of the Pull Request / Additional comments
E_NOINTERFACE
. This then ends up returning an empty list of items and null as a selected item.conhost.exe
that is already on the machine.conhost.exe
default no matter what. (It will still return an error if there are somehow 0 packages because that code changed or some other catastrophic event happened...)nullptr
for a selected item and will just not select anything. By contrast, if it has an exception occur... it will just bubble that out and crash.Validation Steps Performed