Secure mode decorator usage: Follow-up of #13500 and #13548#13554
Merged
Conversation
See test results for failed build of commit 8ed6ab287a |
1. `@blockAction.when` now checks and reports first secure mode, then modal. 2. Add secure mode decorators to future-proof `onCheckForUpdateCommand`. 3. Use secure mode decorator for `onSaveConfigurationCommand`.
02ba923 to
365a58e
Compare
seanbudd
approved these changes
Mar 29, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Follow-up of #13500 and #13548
Summary of the issue:
Some inconsistencies and issues were seen in secure mode usage:
As explained in its documentation
@blockAction.whendecorator should first check more permanent conditions. Thus, the order should be: windows store (per installation), then secure mode (per NVDA session) and then modal dialog opene (can occur during a session).In some cases
@blockAction.whenpreviously checked and reportsed first modal dialog, and then secure mode if no dialog open. This was the case for the following commands decorated in Add secure mode decorators to future-proof code #13548:onCreatePortableCopyCommandonInstallCommandonRunCOMRegistrationFixesCommandOn the contrary, it was not the case for `onAddonsManagerCommand.
Add secure mode decorators to future-proof code #13548 decorated some commands to future-proof them. However, it was not the case for
onCheckForUpdateCommand.In Add UI messages when an action cannot be performed #13500, secure mode decorator was not used for
onSaveConfigurationCommand.Description of how this pull request fixes the issue:
@blockAction.whennow checks and reports first secure mode, then modal for all commands where these two checks are made.Add secure mode decorators to future-proof
onCheckForUpdateCommand.Use secure mode decorator for
onSaveConfigurationCommand. The reported message is now "Action unavailable in secure context" instead of "Cannot save configuration - NVDA in secure mode".Testing strategy:
Manual test:
For 1. and 2., I have created this global plugin copied in an add-on (since the scratchpad cannot be used in secure mode). Thanks to it, I can execute a command of
gui.mainFrameby just selecting the name of this command and pressing NVDA+F6.I have checked for points 1, 2 and 3 the behavior of impacted commands in secure mode and in normal mode. Secure mode was tested by using the flag
-s.For 1. I have tested with and without the About dialog opened.
Known issues with pull request:
None
Change log entries:
Not needed, follow-up of PRs not yet released.
Code Review Checklist: