Closed Bug 1794411 Opened 2 years ago Closed 1 year ago

Add option to force a sync in .get()

Categories

(Firefox :: Remote Settings Client, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: leplatrem, Assigned: leplatrem, NeedInfo)

References

Details

Attachments

(1 file)

Currently, if a consumer needs RS data to be available during the startup phase, we pull the data from the server on new profiles (.get() has syncIfEmpty option set to true by default). However, on existing profiles, we return the content of the local DB.

Synchronization will eventually happen:

  • when the hello response is received from the Push server
  • when the 24H timer kicks in

Certain consumers will want to always obtain the freshest data on startup (eg. experimentation).

This is what was addressed in Bug 1793890, which basically consisted in doing:

try {
  await client.sync();
} catch (e) {}
data = await client.get();

Instead of letting this pattern spread, where each consumer initiates sync organically, I would like to propose to add new option in the .get() method (eg. forceSync), so that we make sure all consumers in this situation behave consistently.

Assignee: nobody → mathieu
Status: NEW → ASSIGNED

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:leplatrem, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(nalexander)
Flags: needinfo?(mathieu)
Pushed by mleplatre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9423b4fe5837
Add option to force a sync in .get() r=nalexander
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch

Removing NI since this landed.

Flags: needinfo?(nalexander)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: