Description
Operating system
Windows
Joplin version
2.3.12
Desktop version info
No response
Current behaviour
On Joplin desktop, it is possible to enter invalid values for integer configurations settings in the UI. Integer configuration settings do not enforce min / max value validation on the very first change to the individual setting, i.e. where the setting is not currently present in the settings.json file. After the value is present in settings.json, then subsequent saves to that setting will correctly cap to the min / max values.
This is a historic bug. A potential solution would be to implement the validation in a similar way to the mobile app, which will suppress updating the state for the configuration setting when an invalid value is entered.
Reproduction steps:
- Start Joplin on a fresh installation (joplin-desktop dir deleted)
- Go to tools, general, appearance, change 'editor font size' to 0 and save it
- Observe that the value in settings.json is stored as 0 (the minimum value is not enforced)
- Restart Joplin
- Go to tools, general, appearance, change 'editor font size' to 1 and save it
- Observe that the value in settings.json is stored as 4 (the minimum value is correctly enforced)
Expected behaviour
The minimum value should be enforced on save, even when the setting is not currently present in settings.json
Logs
No response