Skip to content

Keep a backup of a corrupted config when reinitializing it#15779

Merged
seanbudd merged 3 commits into
nvaccess:masterfrom
CyrilleB79:backupCorruptedConfig
Nov 14, 2023
Merged

Keep a backup of a corrupted config when reinitializing it#15779
seanbudd merged 3 commits into
nvaccess:masterfrom
CyrilleB79:backupCorruptedConfig

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Link to issue number:

Related to #14424 and #14412

Summary of the issue:

In some situation, the configuration file nvda.ini may be corrupted. This can happen if the user has edited the file manually or in some cases when NVDA is downgraded. It may also happen in the case of a bug during the development phase of NVDA (alpha releases) or of add-ons.

When the configuration file is corrupted, it cannot be used. Thus NVDA deletes it and starts with a brand new config. It also warns the user with a message box indicating that the config has been reset and that more information can be found in the log. However in some case, the user may want to fix the issues in the corrupted file manually instead of re-creating all the parameters from the new config.

Description of user facing changes

Before re-creating a new config, a backup of the old corrupted file is saved so that the user can turn back to it if they want. The logged message also indicates the presence of this file.

Description of development approach

See above.

Testing strategy:

Tested this PR by manually corrupting the nvda.ini file, i.e. removing a square bracket to a section name.

Known issues with pull request:

None.

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.

Comment thread source/config/__init__.py Outdated
@seanbudd seanbudd merged commit 3175349 into nvaccess:master Nov 14, 2023
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Nov 14, 2023
@CyrilleB79 CyrilleB79 deleted the backupCorruptedConfig branch November 14, 2023 08:01
@XLTechie

XLTechie commented Nov 15, 2023 via email

Copy link
Copy Markdown
Collaborator

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