Closed Bug 1798041 Opened 3 years ago Closed 3 years ago

"Send Page to Device" shows duplicate entries

Categories

(Firefox :: Sync, defect)

Firefox 108
x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1772415

People

(Reporter: farblos, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

Note: This is similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1403276, but still reproduces in Nightly.

Initialization

  • download and extract Firefox nightly (108.0a1 (2022-10-28)
    (64-bit) in my case)

Set up Primary Firefox

  • start Firefox nightly with active pofile manager:

    ./firefox/firefox -p

    and create a fresh profile "nightly-primary"

  • start Firefox nightly from that profile

  • sign up for a fresh Firefox Account, leaving sync settings on
    default (*)

  • go to "about:preferences#sync", select "Change device name...",
    enter device name "nightly-primary", "Save"

  • quit that Firefox

Set up Secondary Firefox

  • start firefox nightly with active pofile manager:

    ./firefox/firefox -p

    and create a fresh profile "nightly-secondary"

  • start Firefox nightly from that profile

  • sign in to the Firefox Account created above (*)

  • go to "about:preferences#sync", select "Change device name...",
    enter device name "nightly-secondary", "Save"

  • go to "Manage account" and ensure that both devices are
    displayed correctly

  • quit that Firefox

Set up Another Secondary Firefox

  • start firefox nightly with active pofile manager:

    ./firefox/firefox -p

    and delete the previously created profile "nightly-secondary"
    including files.

    Then create a fresh profile "nightly-secondary".

  • start Firefox nightly from that profile

  • sign in to the Firefox Account created above (*)

  • go to "about:preferences#sync", select "Change device name...",
    enter device name "nightly-secondary", "Save"

  • go to "Manage account" and ensure that both devices are
    displayed correctly

  • quit that Firefox

Reproduce the Bug

  • start firefox nightly with active pofile manager:

    ./firefox/firefox -p

    and start from profile "nightly-primary" again.

  • browse to some web page, for example www.gnus.org

  • right click on the web page, select "Send Page to Device" and
    observe two menu entries "nightly-secondary" there

Actual results:

The submenu shows two menu entries "nightly-secondary".

Screenshot attached.

Expected results:

The submenu shows one menu entry "nightly-secondary".

Component: Untriaged → Sync
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

Why are you expecting 1 entry since you have 2 entries with the same name "nightly-secondary".
If you change the name of the third device to other name not matching the second one you will not have this problem.
Please take another look at this and let me know if I am missing something.

Flags: needinfo?(AKFKQU.9DF7RP)

Because you didn't sign-out of the profile you deleted, Firefox Account believes it is still active because it was recently used. After a week or so, this will be hidden as it will no longer be considered "recent". We could detect the dupe and not show it, but then we'd get bug reports that some devices are missing - so we consider this behaviour by design.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(AKFKQU.9DF7RP)
Resolution: --- → INVALID

OK, so I learned I should not simply remove FF-synched profiles when I refresh them, but sign them out first. But anyway:

@Mark: Not in nightly, but in FF 91.13.0esr I have

Weave.Service.clientsEngine.remoteClients.length == 5

(all with unique id's and fxaDeviceId's)

Weave.Service.clientsEngine._knownStaleFxADeviceIds.length == 0

and

fxAccounts.device.recentDeviceList.length == 12

where many lastAccessTimeFormatted of these are larger than "9 months ago", and a couple are even on "a year ago". Not particularly recent. Or do I misunderstand something here?

Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

Or, in other words, https://api.accounts.firefox.com/v1/account/devices for me returns information on all devices I ever had (without signing out), no matter how old.

For those interested in a work-around: Suppose you have a device foo with duplicate entries in the "Send Page to Device" menu. Then sign device foo out from Firefox Sync and immediately after that sign it in again with the same name. That should effectively remove all duplicate entries from the menu.

So my above updates were a bit unstructured, here comes a final overview of one of the remaining duplicates I have in my "production" FF account. To gather the data, I attached with Nightly FF 108.0a1 (2022-10-28) (64-bit) to that FF account.

On the production account I manage 7 devices, one of it being the Nightly FF and one of it named foo@baz, which shows duplicate entries in the menu.

Firefox Account == graphql.accounts.firefox.com

The Firefox Account overview page shows 7 devices.

I think that the Firefox Account overview page gets generated from the following graphql query:

https://graphql.accounts.firefox.com/graphql query GetConnectedClients { ... }

The result of that query contains 11 items, among them 3 named foo@baz:

"deviceId": "32ed9765b2b60989a69e4d5344ead4c3",
"name": "foo@baz",
"lastAccessTime": 1667819068775,
"lastAccessTimeFormatted": "9 hours ago",

"deviceId": "92436d3a7ecec712505b5a562bc586cc",
"name": "foo@baz",
"lastAccessTime": 1643974043770,
"lastAccessTimeFormatted": "9 months ago",

"deviceId": "98e4b829a05ddb7276daee152e502ada",
"name": "foo@baz",
"lastAccessTime": 1625837840490,
"lastAccessTimeFormatted": "a year ago",

However, only the last and oldest one is actually displayed on the Firefox Account overview page.

"Send Page to Device" == fxAccounts.device.recentDeviceList

The "Send Page to Device" menu is populated from fxAccounts.device.recentDeviceList, which, in turn and as far as I understand, feeds on the query result of

https://api.accounts.firefox.com/v1/account/devices

The menu has 9 entries (== 11 minus current one minus incompatible one?), three for device foo@baz. Both variable fxAccounts.device.recentDeviceList and the query result have 11 entries, among them the 3 for foo@baz:

"id": "32ed9765b2b60989a69e4d5344ead4c3",
"isCurrentDevice": false,
"lastAccessTime": 1667819068775,
"name": "foo@baz",

"id": "92436d3a7ecec712505b5a562bc586cc",
"isCurrentDevice": false,
"lastAccessTime": 1643974043770,
"name": "foo@baz",

"id": "98e4b829a05ddb7276daee152e502ada",
"isCurrentDevice": false,
"lastAccessTime": 1625837840490,
"name": "foo@baz",

Weave.Service.clientsEngine.remoteClients

Finally, there is Weave.Service.clientsEngine.remoteClients, which contains 6 items. Here, foo@baz occurs exactly once, and only in its newest instance:

{
  "id": "5ZlODBal53D1",
  "fxaDeviceId": "32ed9765b2b60989a69e4d5344ead4c3",
  "name": "foo@baz",
  "type": "desktop",
  "version": "106.0.5",
  "protocols": [
    "1.5"
  ],
  "os": "WINNT",
  "appPackage": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
  "application": "Firefox",
  "serverLastModified": 1667819102.53
},

Conclusion? Confusion!

Not sure what you make from all that. For me it would be also OK and consistent, to list all instances of foo@baz on the Firefox Account overview page with their last access date. Then I could remove the older ones safely without touching the current one.

The severity field is not set for this bug.
:bdk, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(bdeankawamura)

So I guess there are 2 things here:

  • We do have work in progress to kill old stale devices.
  • A very recently "discarded" device is going to continue to show up for a couple of weeks until it becomes stale, even with the above.

Tarik, can you please dupe this against the bug where your deduping work is happening (to save me finding it :)?

Flags: needinfo?(bdeankawamura) → needinfo?(teshaq)

Hey :farblos!

Thanks a ton for filing this and digging so deep into the problem! I'll provide some context below this and mark this as duplicate, but if the something else is amiss, feel free to re-open and we can discuss it further!

  1. The firefox accounts "connected services"/overview:
    This is a list of all your connected services to firefox accounts, this includes all of:
    1. Devices
    2. oAuth Clients
    3. Web Sessions

The API is smart in merging each mobile device and its oAuth Client, and merging each desktop and its web session. Additionally the accounts.firefox.com web app, will filter devices that have the same name. You can try changing the name of your current device and you might see a new entry pop out! The filtering explains why you only see one device!

  1. The "devices list"/send tab list:
    This is a list of all devices that support send tab. The list is currently unfiltered beyond checking for send tab support. This explains why you see all three duplicate devices! There is a bug in this list that I landed a fix for last week (should be in prod this week) see: https://github.com/mozilla/fxa/pull/14433. Once that hits prod we're planning on shipping a change that filters this list on the clients, so that only recent devices are shown.

  2. The sync clients list
    This list is not managed by firefox accounts and instead is synced using sync from one device to another. I believe The sync clients list tries to filter out idle sync clients by timestamp (similar to what we're planning to do in the devices list!) so that explains the more "up to date" list

What's next

  • I have https://bugzilla.mozilla.org/show_bug.cgi?id=1772415 filed to filter the device list, which should land before the end of this week for the "duplicate" entries part of this bug
  • We are also discussing if we should automatically sign users out of devices that haven't been accessed in a long time, but there is no timeline for that yet

Please feel free to comment more if there any other pieces I missed here!

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago3 years ago
Duplicate of bug: 1772415
Flags: needinfo?(teshaq)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: