Skip to content

Secure mode decorator usage: Follow-up of #13500 and #13548#13554

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
CyrilleB79:secModeDecorator
Mar 30, 2022
Merged

Secure mode decorator usage: Follow-up of #13500 and #13548#13554
seanbudd merged 1 commit into
nvaccess:masterfrom
CyrilleB79:secModeDecorator

Conversation

@CyrilleB79

Copy link
Copy Markdown
Contributor

Link to issue number:

Follow-up of #13500 and #13548

Summary of the issue:

Some inconsistencies and issues were seen in secure mode usage:

  1. As explained in its documentation @blockAction.when decorator 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.when previously 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:

    • onCreatePortableCopyCommand
    • onInstallCommand
    • onRunCOMRegistrationFixesCommand
      On the contrary, it was not the case for `onAddonsManagerCommand.
  2. Add secure mode decorators to future-proof code #13548 decorated some commands to future-proof them. However, it was not the case for onCheckForUpdateCommand.

  3. 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:

  1. @blockAction.when now checks and reports first secure mode, then modal for all commands where these two checks are made.

  2. Add secure mode decorators to future-proof onCheckForUpdateCommand.

  3. 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.mainFrame by 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:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@AppVeyorBot

Copy link
Copy Markdown

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`.
@CyrilleB79 CyrilleB79 marked this pull request as ready for review March 29, 2022 06:41
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner March 29, 2022 06:41
@seanbudd seanbudd merged commit bcc3fc7 into nvaccess:master Mar 30, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone Mar 30, 2022
@CyrilleB79 CyrilleB79 deleted the secModeDecorator branch March 30, 2022 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants