Skip to content

Fixup #12984 for isInMessageBox backwards compatibility#13011

Merged
seanbudd merged 5 commits into
betafrom
fix-messageBox-backCompat
Nov 4, 2021
Merged

Fixup #12984 for isInMessageBox backwards compatibility#13011
seanbudd merged 5 commits into
betafrom
fix-messageBox-backCompat

Conversation

@seanbudd

@seanbudd seanbudd commented Nov 1, 2021

Copy link
Copy Markdown
Member

Link to issue number:

Fix up of #12984

Summary of the issue:

Backwards compatibility for the following code was broken in 2021.3 beta.

from gui import isInMessageBox

Note: this code creates a copy of the value of isInMessageBox, and as such, was only accurate if it was being imported when it was being checked. Importing like this also prevents gui.isInMessageBox from being updated:

from gui import isInMessageBox
isInMessageBox = False  # this doesn't update gui.isInMessageBox

Description of how this pull request fixes the issue:

Creates a isInMessageBox that is updated by isInMessageBox.
Note that while from gui import isInMessageBox can run without error now, using or updating the variable will not work as expected, nor has it ever worked properly.

Testing strategy:

Manual testing with 2021.2 and this PR

  1. Open the NVDA python console
  2. With no other NVDA dialogs open, run this code snippet, confirm the result is False, False
    from gui import isInMessageBox
    print(isInMessageBox)
    
    import gui
    print(gui.isInMessageBox)
  3. Open the About dialog, run the code snippet, confirm the result is False, True, True
    print(isInMessageBox)
    
    from gui import isInMessageBox
    print(isInMessageBox)
    
    import gui
    print(gui.isInMessageBox)
  4. With no other NVDA dialogs open, run this code snippet, confirm the result is False, True
    from gui import isInMessageBox
    isInMessageBox = True
    
    import gui
    print(gui.isInMessageBox)
    
    gui.isInMessageBox = True
    print(gui.isInMessageBox)

Known issues with pull request:

None

Change log entries:

None needed, fixes regression

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

@seanbudd seanbudd marked this pull request as ready for review November 1, 2021 02:07
@seanbudd seanbudd requested a review from a team as a code owner November 1, 2021 02:07
@seanbudd seanbudd requested review from feerrenrut and michaelDCurran and removed request for a team November 1, 2021 02:07
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 76b6d92cc0

michaelDCurran
michaelDCurran previously approved these changes Nov 1, 2021
Comment thread source/gui/__init__.py Outdated

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@seanbudd seanbudd added this to the 2021.3 milestone Nov 3, 2021
@seanbudd seanbudd merged commit 465ffb8 into beta Nov 4, 2021
@seanbudd seanbudd deleted the fix-messageBox-backCompat branch November 4, 2021 00:47
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