Skip to content

Fix profile upgrade from 13 to 14#17589

Merged
SaschaCowley merged 4 commits into
masterfrom
fixProfileUpgrade
Jan 7, 2025
Merged

Fix profile upgrade from 13 to 14#17589
SaschaCowley merged 4 commits into
masterfrom
fixProfileUpgrade

Conversation

@SaschaCowley

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #17587
Fixes #17588

Summary of the issue:

The profile upgrade steps introduced in #17547 would cause NVDA to crash, and the user's configuration to be reset, if the user had an audio output device set in their NVDA configuration.

Description of user facing changes

Upgrading from configuration version 13 to 14 no longer crashes NVDA and resets the user's configuration.

Description of development approach

The issue was caused because config.profileUpgradeSteps.upgradeConfigFrom_13_to_14 attempts to import nvwave, which, through its own imports, eventually attempts to use gettext. Since gettext has not yet been initialised, this raises an exception. As we are so early in NVDA initialisation, this exception causes the rest of NVDA's initialisation to fail critically.

To resolve this, _getOutputDevices and _AudioOutputDevice have been moved to the new utils.mmdevice. I initially thought to move them to audio.utils, but initialisation of audio runs into the same problem.

Testing strategy:

Checked out a7fa0d6, made sure the config version was 13, ran NVDA and selected an audio output device. Checked out fixProfileUpgrade, ran NVDA, and ensured that it ran as expected, the profile was correctly updated, there was no loss of settings, and the correct output device was in use.

Known issues with pull request:

None known.

Code Review Checklist:

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

@coderabbitai summary

@SaschaCowley SaschaCowley requested a review from a team as a code owner January 7, 2025 02:59
@SaschaCowley SaschaCowley requested a review from seanbudd January 7, 2025 02:59
Comment thread tests/unit/test_config.py Outdated
Comment thread source/utils/mmdevice.py
SaschaCowley and others added 2 commits January 7, 2025 14:27
Co-authored-by: Sean Budd <sean@nvaccess.org>
Co-authored-by: Sean Budd <sean@nvaccess.org>
@SaschaCowley SaschaCowley merged commit 15fc797 into master Jan 7, 2025
@SaschaCowley SaschaCowley deleted the fixProfileUpgrade branch January 7, 2025 22:01
@github-actions github-actions Bot added this to the 2025.1 milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants