Only save the relevant TorSettings changes to preferences.
At the moment we call #saveToPrefs
whenever changeSettings
, which will save all settings - bridges, proxy and firewall - to preferences, even if only a subset of these were changed.
I think we should change these to only save a subset of the relevant changes. In particular, it should make our code more recoverable. E.g. if we have a bug in TorSettings
that causes #loadFromPrefs
to fail and we are stuck with default bridge settings for the session, we do not want to unnecessarily overwrite the preference values for bridges when the user changes their proxy settings. Such as the scenario described in #43765 (closed).
This would also be similar to what we did in #43405 (closed), where we avoided writing all settings to the provider in one block.