Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix up config upgrade steps from schema version 14 to 15 (#17642)
Fixes #17637 Follow-up to #17505 Summary of the issue: The config upgrade steps for moving from version 14 to 15 of the config schema may leave the user's config in an invalid state if either of `["keyboard"]["speakTypedCharacters"]` or `["keyboard"]["speakTypedWords"]` is not a boolean. This is because the upgrade steps, as implemented, take no action if those values are not bools. For most upgrade steps, this approach is perfectly valid. However, version 15 of the schema expects these values to be integers, so validation of the upgraded config will fail. Description of user facing changes The configuration upgrade should not corrupt the user's config. Description of development approach Instead of just `return`ing when we get a `ValueError` in `upgradeConfigFrom_14_to_15`, delete the offending config entry. Testing strategy: Tested by creating valid and invalid config strings, instantiating `ConfigObj`s with them, and feeding those to `upgradeConfigFrom_14_to_15`. Known issues with pull request: A user may lose their setting for "Speak typed characters" or "Speak typed words", if configobj doesn't recognise it as a boolean. Theoretically this shouldn't be possible, as the config wouldn't have validated under any of the prior schema versions. Nevertheless this seems to have happened, and it is better to lose (at most) 2 settings than all settings.
- Loading branch information