Closed Bug 1779094 Opened 2 years ago Closed 2 years ago

Improve Internal handling of user search settings within SearchSettings.jsm

Categories

(Firefox :: Search, task, P2)

task

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: mcheang, Assigned: mcheang)

References

()

Details

Attachments

(3 files)

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
this._settings.setUserSettingsAttribute
  • Create getters and settings for #currentSettings.engines._metadata
this._settings.setEngineMetaData
  • Rename setAttribute to setMetaDataAttribute
  • Change all calls to setAttribute to setMetaDataAttribute
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.

Severity: S2 → N/A
Status: NEW → ASSIGNED
Attachment #9285014 - Attachment description: WIP: Bug 1779094 - Improve internal handling of user search settings. r=adw, → Bug 1779094 - Improve internal handling of user search settings. r=adw
Attachment #9285014 - Attachment description: Bug 1779094 - Improve internal handling of user search settings. r=adw → Bug 1779094 - Improve internal handling of user search settings. r=Standard8

This patches removes the top level settings metadata object.

Any updates to the metadata will be done on the 2nd level object
#currentSettings.metaData instead. Removing the top level metadata object, we
improve code clarity by only having one metadata object and not two
metadata objects.

Attachment #9285014 - Attachment description: Bug 1779094 - Improve internal handling of user search settings. r=Standard8 → Bug 1779094 - Improve internal handling of user search settings Part II. r=Standard8
Pushed by mcheang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/32bd53c3dd84
Improve internal handling of user search settings Part I. r=Standard8
https://hg.mozilla.org/integration/autoland/rev/54f9c347df9a
Improve internal handling of user search settings Part II. r=Standard8

Backed out for causing talos damp failures

Flags: needinfo?(mcheang)
Pushed by mlaza@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/54110b0b3d1c
Improve internal handling of user search settings Part I. r=Standard8
https://hg.mozilla.org/integration/autoland/rev/fad2e0fe5101
Improve internal handling of user search settings Part II. r=Standard8

Re land because we think the problem it's from another push - Bug 1783160

Flags: needinfo?(mcheang)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: