gecko-dev/services
Rob Wu 0ceb5a55a2 Bug 1640291 - Read RemoteSettings dump before cache, and minimize unnecessary reads r=leplatrem
This commit does the following:

- Feature / Optimization: Check the dump before the cache, instead of
  the reverse. The dump is expected to match the requested attachment in
  the common case, and checking it first helps with ensuring that the
  expected (packaged dump) is used when available.

- Optimization: Defer reading the cached attachment until it's needed.

- Refactor / Feature: Treat a missing `.meta.json` file as a sign that
  the attachment dump does not exist, rather than an error.
  Previously, if an attachment cannot be downloaded from the network,
  that error would be replaced with a generic `DownloadError` (from the
  missing `.meta.json` file). This is mostly relevant for telemetry.

- Refactor / Maintainability: Create helper to manage lazy access to the
  record and attachment, to ensure that the record and attachment is
  only read on demand, and at most once.

- Refactor / Readability: Move the common return value generation logic
  to the helper as `getResult`, to avoid the verbose duplication of the
  logic. Now the return value fits in one line instead of 5-6 lines.

- Fix test: Rename filename-of-dump.meta.json and fix test expectation
  to ensure that the test checks the absence of the file content,
  rather than the absence of the meta data file.

Differential Revision: https://phabricator.services.mozilla.com/D76962
2020-05-27 08:00:43 +00:00
..
automation Bug 1622328 - add license info to all eslintrc files r=Standard8,webcompat-reviewers,miketaylr 2020-03-19 13:47:51 +00:00
common Bug 1637178 - Distinguish local DB hijacks from sign errors in Uptake Telemetry r=Gijs 2020-05-26 11:20:03 +00:00
crypto Bug 1622666 - Removes redundant access specifier r=froydnj 2020-03-22 11:58:15 +00:00
fxaccounts Bug 1640765 - only build the rust fxa-client crate on Nightly. r=lina 2020-05-27 05:51:39 +00:00
interfaces Bug 1636365 - Add more docs for BridgedEngine, and remove BridgedTracker. r=markh,rfkelly 2020-05-13 03:56:55 +00:00
settings Bug 1640291 - Read RemoteSettings dump before cache, and minimize unnecessary reads r=leplatrem 2020-05-27 08:00:43 +00:00
sync Bug 1640528 - Allow extension storage to be enabled and disabled independently of add-ons. r=markh 2020-05-25 01:12:16 +00:00
moz.build Bug 1596322 - Add XPCOM bindings for Rust Sync engines. r=markh,tcsc,LougeniaBailey 2020-04-09 15:45:37 +00:00