mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00

Instead of using the list of FxA devices from the Sync clients engine, we now fetch the list of Send Tab devices from FxA. This works like this: * `FxAccountsDevice#getDeviceList` has been split up into `recentDeviceList` and `refreshDeviceList`. * `recentDeviceList` synchronously returns the last fetched list, so that consumers like Send Tab can use it right away. * `refreshDeviceList` is asynchronous, and refreshes the last fetched list. Refreshes are limited to once every minute by default, matching the minimum sync interval (Send Tab passes the `ignoreCached` option to override the limit if the user clicks the "refresh" button). Concurrent calls to `refreshDeviceList` are also serialized, to ensure the list is only fetched once. * The list is flagged as stale when a device is connected or disconnected. It's still kept around, but the next call to `refreshDeviceList` will fetch a new list from the server. * The Send Tab UI refreshes FxA devices in the background. Matching FxA devices to Sync client records is best effort; we don't do it if Sync isn't configured or hasn't run yet. This only impacts the fallback case if the target doesn't support FxA commands. Differential Revision: https://phabricator.services.mozilla.com/D47521 --HG-- extra : moz-landing-system : lando