mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
0ceb5a55a2
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 |
||
---|---|---|
.. | ||
automation | ||
common | ||
crypto | ||
fxaccounts | ||
interfaces | ||
settings | ||
sync | ||
moz.build |