Skip to content

Bugfix when resetting configuration#14894

Merged
seanbudd merged 4 commits into
nvaccess:masterfrom
CyrilleB79:saveConfig
May 3, 2023
Merged

Bugfix when resetting configuration#14894
seanbudd merged 4 commits into
nvaccess:masterfrom
CyrilleB79:saveConfig

Conversation

@CyrilleB79

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #13187

Summary of the issue:

After having modified a parameter in a profile and then reset it to its original value with NVDA+control+C, it was not possible to save the configuration with NVDA+control+R; NVDA was complaining that the file system was probably read-only.

Description of user facing changes

NVDA will no longer refuse to save the configuration after a configuration reset.

Description of development approach

Bugfix: when resetting the config, config.conf._dirtyProfiles is cleared

I have also narrowed the exception filtering when saving the config since in #13187, we get a message related to file write error, whereas the real error had nothing to do with it: it was a KeyError when trying to find "notepad" in config.conf._profileCache. I have filtered on PermissionError which is the error that I get when I set nvda.ini (or the whole NVDA setting folder) as read-only and try to save the config.

Testing strategy:

Manual tests:

Test 1

Check that NVDA+control+R can still save the configuration in normal case

Test 2

Reproduce the steps in #13187 and check that we get expected result as described there.

Test 3

Set file nvda.ini or whole NVDA settings folder as read only and try to save the config with NVDA+shift+C. Check that we still get the error message.

Test 4

  • Add an unknown variable in the try clause of ConfigManager.save in config.__init__.py.
  • Try to save the config
  • Check that we do not get the Error dialog box but an error in the log.

Known issues with pull request:

None

Change log entries:

Bug fixes

NVDA will no longer refuse to save the configuration after a configuration reset. (#13187)

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
  • Security precautions taken.

@CyrilleB79 CyrilleB79 marked this pull request as ready for review May 2, 2023 11:39
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner May 2, 2023 11:39
@CyrilleB79 CyrilleB79 requested a review from seanbudd May 2, 2023 11:39
@seanbudd seanbudd merged commit 345154a into nvaccess:master May 3, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.2 milestone May 3, 2023
@CyrilleB79 CyrilleB79 deleted the saveConfig branch May 3, 2023 10:27
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.

Error when saving configuration

3 participants