-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.4.0
-
Fix Version/s: 4.4.2
-
Component/s: Configuration
Issue
Scenario:
- the synchronization_enabled parameter is set on the server's config.
- at the next start, the synchronization_enabled is set in the local config and different from the server's value, then it will have no effect
Wanted Behavior
The local value should be taken into account.
Analysis
The whole block of code:
# Handle synchronization state early sync_enabled = self.dao.get_config("synchronization_enabled") if sync_enabled is not None: # If the option has been set from another conf source, it has the precedence # over the old (and maybe obsolete) value stored in the database if ( Options.options["synchronization_enabled"][1] != "default" and Options.synchronization_enabled != sync_enabled ): # Update the value stored in the database using the the global options value self.dao.update_config("sync_enabled", Options.synchronization_enabled) else: # Update global options using the value stored in the database Options.synchronization_enabled = sync_enabled != "0"
That line is bad:
self.dao.update_config("sync_enabled", Options.synchronization_enabled)
Here we can see that the parameter we are looking for is "synchronization_enabled" but when saving into the database we use "sync_enabled". So the preference is never used.