Properly convert strings to booleans when upgrading profiles to the new schema#14183
Merged
seanbudd merged 1 commit intoSep 26, 2022
Conversation
Contributor
Author
|
@CyrilleB79 You may also want to review this. |
Contributor
|
Good catch @lukaszgo1, many thanks! |
seanbudd
approved these changes
Sep 26, 2022
Member
|
@lukaszgo1 - can you open temp |
Member
|
I've changed the base to master temporarily to run the build system and tests on AppVeyor. This needs to retarget |
Contributor
|
Is it possible that this fixes the cause of: |
Member
6 tasks
feerrenrut
pushed a commit
that referenced
this pull request
Nov 23, 2022
Closes #14170 Summary: For some GUI settings, a difference between the default (base) profile and another profile, could have unexpected results. An example: - A profile named 'Notepad' with setting (GUI option) 'line indentation reporting' to 'tones' - The default profile with the same GUI option set to 'speech' - Result: indentation reported with speech and tones instead of tones only when returning to notepad - Issue #14170 contains detailed steps. Only one combo-box was used to set line indentation reporting in the UI, but the value of this combo-box was saved in two items in the configuration. These two items were then managed separately when dealing with configuration profile switching. The following combo-boxes in the GUI were impacted by this issue: * "Line indentation reporting" in doc formatting settings - See initial description of #14170 * "Cell borders" in doc formatting settings - See #14170 (comment) * "Show messages" combined with "Message timeout" in braille settings - See #14170 (comment) * "Tether Braille" in braille settings - See #14170 (comment) Change for users: The values of the following settings should not change unexpectedly anymore when switching profile: * Line indentation in Document formatting settings. * Cell borders in doc formatting settings * Show messages in braille settings * Tether Braille in braille settings Approach: * One control in the GUI now matches one and only one item in the config * Upgrade the config adequately * Used the same approach as #14132 (and the fix in #14183) A note on profile upgrade: Because it is possible for arbitrary stacking order for config profiles it is not possible to determine the setting which would be expected by the user. Config stacking can be caused by mixes of the following, default/base, manually enabled profile, app triggered profile, say-all triggered profile
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.
Opened against branch for 2022.4 since this fixes regression which ideally should not get into the release.
Link to issue number:
None, fix-up of #14132
Summary of the issue:
When upgrading configurations to the new versions of the schema we often need to check what value was set previously as not to change user preferences. In our profile upgrade steps we relied on the fact that false values in the config are falthy in the boolean context, but at the state where profile is upgraded these are not yet transformed into right types, so a value set to
Falseis set to literal string"False"which is always truthy in a boolean context.I've discovered this when, after #14132 got merged, in the profile where I had reporting of row and column headers disabled it got re-enabled after the schema update.
Description of user facing changes
People who have reporting of row and column header disabled would still have them disabled after updating to NVDA 2022.4.
Description of development approach
In places where we check if the option is set to
Truein our profile upgrade steps I used the defaultconfigobjconverter between string and booleans to convert options into the right values. In addition I've removed some unnecessarypassstatements and some variables capturing exceptions which weren't used.While fixing previous upgrade steps would not help people who are upgrading NVDA regularly it still made sense to do so, to support people who skipped several upgrades and to have consistent style for the upgrade steps.
Testing strategy:
With a config profile using previous version of the schema and with reporting of row and column headers disabled upgraded into the latest schema - made sure reporting of row and column headers remained disabled.
Known issues with pull request:
People on Alpha who had reporting of rows and column disabled still have to set the configuration manually - there is no way to fix this automatically.
Change log entries:
None needed - unreleased regression.
Code Review Checklist: