When opening the PreferencesPane, nodes in the underlying Preferences sometimes get updated immediately, exactly as a result of Envisage's attempts to make sure that doesn't happen.
The issue is with the clone_traits: at some point, the clone_traits operation will clone the preferences trait. Any preference value cloned after that happens will trigger an update back to the Preferences model, through the _anytrait_changed handler on PreferencesHelper. The line after clone_traits sets preferences to None so that changes to the helper are not propagated to the preferences node, but at that point it's too late for the changes that have already been propagated.
When opening the
PreferencesPane
, nodes in the underlyingPreferences
sometimes get updated immediately, exactly as a result of Envisage's attempts to make sure that doesn't happen.The relevant code is here: https://github.com/enthought/envisage/blob/4ec68a482a2ff1e5a92828d0cceaf79d808fc177/envisage/ui/tasks/preferences_pane.py#L67-L69
The issue is with the
clone_traits
: at some point, theclone_traits
operation will clone thepreferences
trait. Any preference value cloned after that happens will trigger an update back to thePreferences
model, through the_anytrait_changed
handler onPreferencesHelper
. The line afterclone_traits
setspreferences
toNone
so that changes to the helper are not propagated to the preferences node, but at that point it's too late for the changes that have already been propagated.