-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Preferences
-
None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
3
-
Not Needed
-
Iteration Xantic Sargo, Iteration Zebrafish, Iteration Ankylosaurus, Iteration Brontosaurus
Problem Statement/Rationale
We want to be able to change default values for application preferences between Compass releases, for example so that we can change whether or not some feature flags are enabled or disabled by default.
This is currently not possible as on every application start we persist preferences on disk, including default values not changed by the user. This means that on next application start (and after application update) preferences values saved on disk will take precedence over the default values declared on the model
Steps to Reproduce
If running development build:
- Add new preferences property with default value
- Start application locally and check that default value matches the one defined in code
- Stop the application
- Change default value in model definition
- Start the application again and check the value. You should see that the old default value is still preserved
With a beta:
- (if you already have the Beta installed, clean up your app preferences)
- Install https://github.com/mongodb-js/compass/releases/tag/v1.35.1-beta.3
- Run the app at least once
- Update the beta either with autoupdate or manually from https://github.com/mongodb-js/compass/releases/tag/v1.35.1-beta.5
- Run the app again and check feature flag options, you'll see "focus mode editor" option disabled, even though it should be enabled
Expected Results
Default values should change with code changes
Actual Results
Default values are persisted on disk and new default values are not picked up
Additional Notes
AppPreferences model persists all the properties on disk, even when they were never updated by the user, we probably want to persist them only when they were changed by the user through the UI