Closed Bug 1582769 Opened 5 years ago Closed 3 years ago

Improve `syncIfEmpty` documentation

Categories

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

defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: leplatrem, Assigned: leplatrem)

Details

Attachments

(1 file)

ehsan> any chance you could please weigh in on https://phabricator.services.mozilla.com/D46029?
we think this is probably incorrect docs, but we'd like you to confirm

leplatrem> Indeed, if you pass syncIfEmpty: false we don't even bother checking the local DB. AFAIK in your use-case, since you deliver a local JSON dump, you can leave syncIfEmpty: true (default) and it will load data from resource:// if local DB is empty

ehsan> so this documentation is wrong then, correct? https://searchfox.org/mozilla-central/source/services/common/docs/RemoteSettings.rst#43
(it makes it sound like local data would be returned with syncIfEmpty: false)

leplatrem> hmm, the and if no initial data was provided refers to the JSON dump I admit that a lot of cases are summarized in one long sentence, which is unclear we should add a clarification for the case when a JSON dump (aka initial data) is provided

syncIfEmpty: implicit synchronization if local data is empty (default: true).
this read to me and at least one other person as:

  if no data present and syncIfEmpty is true, sync from network
  otherwise return whatever local data we have, if any

whereas the code behaves as:

  if syncIfEmpty is true, sync from network if no data is present
  return whatever data we have, if any

it was only through reading the code that we understood the second behaviour, and even then we still couldn't understand the documentation as describing it as such

The priority flag is not set for this bug.
:leplatrem, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mathieu)
Flags: needinfo?(mathieu)
Priority: -- → P2
Assignee: nobody → mathieu
Attachment #9205665 - Attachment description: Bug 1582769 - Improve syncIfEmpty documentation and the synchronization process → Bug 1582769 - Improve documentation about syncIfEmpty option and the synchronization process
Status: NEW → ASSIGNED
Attachment #9205665 - Attachment description: Bug 1582769 - Improve documentation about syncIfEmpty option and the synchronization process → Bug 1582769 - Improve syncIfEmpty documentation and the synchronization process
Pushed by mleplatre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e2a6fb626b30
Improve syncIfEmpty documentation and the synchronization process r=Standard8 DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: