Fix profile upgrade from 13 to 14#17589
Merged
Merged
Conversation
seanbudd
reviewed
Jan 7, 2025
seanbudd
approved these changes
Jan 7, 2025
Co-authored-by: Sean Budd <sean@nvaccess.org>
Co-authored-by: Sean Budd <sean@nvaccess.org>
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:
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_14attempts to importnvwave, 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,
_getOutputDevicesand_AudioOutputDevicehave been moved to the newutils.mmdevice. I initially thought to move them toaudio.utils, but initialisation ofaudioruns into the same problem.Testing strategy:
Checked out
a7fa0d6, made sure the config version was13, ran NVDA and selected an audio output device. Checked outfixProfileUpgrade, 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:
@coderabbitai summary