Bug 1559421 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Updating what data we'll be hooking up to the Lockwise card in this issue, based on the [mockups](https://treeherder.mozilla.org/#/jobs?repo=try&revision=f05b7d2f845f63168e46af11e7b6e2fabb4e4c15). In Bug 1559418, we have already implemented counting the number of stored logins via `Services.logins.countLogins`. So now what's left is to display the number of synced devices linked to the user's account. We've been provided with some good places to start (thanks Ryan Kelly!): 

- The simplest approach is to ping the server everytime the page is loaded using [getDeviceAccountsList()](https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/services/fxaccounts/FxAccounts.jsm#751) from `FxAccounts.jsm`.
- To avoid doing this, we'll need to take some extra steps, which Ryan has also provided:
```
1) Checking whether sync has already loaded the list of devices in the background:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#54

2) If it hasn't, showing some placeholder UI and triggering a sync:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#273

3) Getting the list of devices out of sync's "clients" engine, which has a local cache of it:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#64
```
Updating what data we'll be hooking up to the Lockwise card in this issue, based on the [mockups](https://treeherder.mozilla.org/#/jobs?repo=try&revision=f05b7d2f845f63168e46af11e7b6e2fabb4e4c15). In Bug 1559418, we have already implemented using the number of stored logins returned via `Services.logins.countLogins`. So now what's left is to display the number of synced devices linked to the user's account. We've been provided with some good places to start (thanks Ryan Kelly!): 

- The simplest approach is to ping the server everytime the page is loaded using [getDeviceAccountsList()](https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/services/fxaccounts/FxAccounts.jsm#751) from `FxAccounts.jsm`.
- To avoid doing this, we'll need to take some extra steps, which Ryan has also provided:
```
1) Checking whether sync has already loaded the list of devices in the background:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#54

2) If it hasn't, showing some placeholder UI and triggering a sync:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#273

3) Getting the list of devices out of sync's "clients" engine, which has a local cache of it:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#64
```
Updating what data we'll be hooking up to the Lockwise card in this issue, based on the [mockups](https://treeherder.mozilla.org/#/jobs?repo=try&revision=f05b7d2f845f63168e46af11e7b6e2fabb4e4c15). In Bug 1559418, we are already using the number of stored logins reported via `Services.logins.countLogins`. So now what's left is to display the number of synced devices linked to the user's account. We've been provided with some good places to start (thanks Ryan Kelly!): 

- The simplest approach is to ping the server everytime the page is loaded using [getDeviceAccountsList()](https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/services/fxaccounts/FxAccounts.jsm#751) from `FxAccounts.jsm`.
- To avoid doing this, we'll need to take some extra steps, which Ryan has also provided:
```
1) Checking whether sync has already loaded the list of devices in the background:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#54

2) If it hasn't, showing some placeholder UI and triggering a sync:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#273

3) Getting the list of devices out of sync's "clients" engine, which has a local cache of it:

    https://dxr.mozilla.org/mozilla-central/rev/6a2bd09a6bf9aada14581e923408d7308479b76d/browser/base/content/browser-sync.js#64
```

Back to Bug 1559421 Comment 1