No versioning for settings

Bug #1813475 reported by Siergiej Riaguzow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xpad
Confirmed
Medium
Siergiej Riaguzow

Bug Description

~/.config/xpad/default-style is generated when something is changed in configuration (like a button is removed from the toolbar). Unfortunately, later on, if in some version, another button will be added, like it is the case for https://bugs.launchpad.net/xpad/trunk/+bug/452226 where "find" button is added during implementation, ~/.config/xpad/default-style had to be deleted for it to appear or a button has to be added manually.

This means that if preferences change:
- user might not even find out about the change
- if they change drastically leading to incompatibility with the old one, there may be bugs

I will not add versioning as part of resolving of https://bugs.launchpad.net/xpad/trunk/+bug/452226 but I think some integer field can be added to XpadSettings and written to ~/.config/xpad/default-style so that if someone changes the settings (like adding a new toolbar button) he can bump this integer to be higher, so ~/.config/xpad/default-style will be removed if it doesn't contain a version at all or a different version (maybe even greater, but it may be so that backward compatibility is not preserved) and default style is used instead.

This integer should be bumped in very rare cases (when indeed something is changed in settings) so that not to confuse user with removing his customizations all the time

Changed in xpad:
assignee: nobody → Siergiej Riaguzow (riaguzov)
Changed in xpad:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Arthur Borsboom (arthurborsboom) wrote :

I agree with your findings and reasoning.

Thinking about how to implement this, this idea crossed my mind.

We have to implement:
- a configuration versioning schema numberering: to keep it simple, we could use the Xpad version number.
- a lookup table which elements in the configuration file correspond with which version of Xpad. This gives us the possibility to upgrade the configuration file by adding new items (for example first_pad_color_default) and to remove obsolete/deprecated items.
- a automatic validation and upgrade/downgrade of the configuration file up-triggered on Xpad application startup.

I bet there is existing code for this which we can use as a base.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.