Bug 1779094 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I'm working on search management improvements for this current sprint. 
One of these improvements involves our internal handling of user settings. 

We would like to cache the user settings to maintain data integrity. After that is done, it can help with fixing Bug 1596398 so we do not rewrite the user settings on startup every time. 

After some thought, I've broken down the task into smaller steps: 
* Deep clone `_metaData` and `#currentSettings` - Clone version is read only (`#cachedMetaData` and `#cachedCurrentSettings`)
* Create a method to compare `#cachedCurrentSettings` and `#currentSettings`
* Compare `#cachedCurrentSettings` and `#currentSettings` **before** writing to disk within `_write`. If it has changed, write to disk, otherwise do not write to disk.
* Create getters and setters for `#currentSettings`
```js
this._settings.setUserSettingsAttribute
```
* Create getters and settings for `#currentSettings.engines._metadata`
```js
this._settings.setEngineMetaData
```
* Rename `setAttribute` to `setMetaDataAttribute`
* Change all calls to `setAttribute` to `setMetaDataAttribute`

```js
this._settings.setMetadataAttribute
```
* Differentiate between userSettingsFile and SettingsObject better by renaming these two objects
* Write tests to compare performance on startup when we're not writing the settings file versus when we are
* Write tests to validate the caching is working
* Write test for new methods added


There's an attachment of the SearchSettings.jsm Object and the userSettings Object that we read from disk to reference the structure of it.
I'm working on search management improvements for this current sprint. 
One of these improvements involves our internal handling of user settings. 

We would like to cache the user settings to maintain data integrity. After that is done, it can help with fixing Bug 1596398 so we do not rewrite the user settings on startup every time. 

After some thought, I've broken down the task into smaller steps: 
* Deep clone `_metaData` and `#currentSettings` - Clone version is read only (`#cachedMetaData` and `#cachedCurrentSettings`)
* Compare `#cachedCurrentSettings` and `#currentSettings` **before** writing to disk within `_write`. If it has changed, write to disk, otherwise do not write to disk.
* Create getters and setters for `#currentSettings`
```js
this._settings.setUserSettingsAttribute
```
* Create getters and settings for `#currentSettings.engines._metadata`
```js
this._settings.setEngineMetaData
```
* Rename `setAttribute` to `setMetaDataAttribute`
* Change all calls to `setAttribute` to `setMetaDataAttribute`

```js
this._settings.setMetadataAttribute
```
* Differentiate between userSettingsFile and SettingsObject better by renaming these two objects
* Write tests to compare performance on startup when we're not writing the settings file versus when we are
* Write tests to validate the caching is working
* Write test for new methods added


There's an attachment of the SearchSettings.jsm Object and the userSettings Object that we read from disk to reference the structure of it.

Back to Bug 1779094 Comment 0