Closed Bug 1799077 Opened 2 years ago Closed 2 years ago

[iOS] Synced tabs from the iOS devices are not displayed on desktop after signing in to another sync account on the iOS device even though the devices appear on `Send to device` option, and the synced tabs from iOS are displayed on Android

Categories

(Firefox :: Sync, defect)

Desktop
All
defect

Tracking

()

RESOLVED MOVED
Tracking Status
firefox106 --- affected
firefox107 --- affected
firefox108 --- affected

People

(Reporter: atrif, Unassigned)

References

()

Details

(Keywords: regressionwindow-wanted)

Attachments

(1 file)

Attached file synczip.zip

Found in

  • 108.0a1 (2022-11-03)

Affected versions

  • Firefox Nightly (2022-11-03)
  • Firefox 106.0.4

Tested platforms

  • Affected platforms: iOS, iPhone 11, Ubuntu 20.04, macOS 12, Windows 10x64
  • Unaffected platforms: Android 12 SM-A715F/DS

Steps to reproduce

  1. Sign in with a sync account on the iOS device and then sign out.
  2. Sign in with another sync account on iOS device and with the same account sign in to sync on a desktop machine.
  3. Perform a sync and see synced tabs.

Expected result

  • Synced tabs are displayed.

Actual result

  • Synced tabs from iOS are not displayed on the desktop and vice-versa.

Additional notes

  • Signing in to the same sync account on an Android device will display the synced tabs from the iOS and desktop devices.
  • iOS device will appear on the desktop on Send to device option after a tab is sent from iOS to the desktop.
  • On the desktop the iOS device appears inside the Send to device option list and vice-versa. Sending tabs from iOS to desktop works as expected and vice-versa.
  • Uninstalling and reinstalling Firefox on the iOS device and signing in back to sync will display the synced tabs.
  • Attaching about:sync notes from the sync addon and console. If any other logs are needed please let us know.

I was able to reproduce this issue with firefox desktop release v106.0.1 and firefox iOS beta v107.0. While desktop didn't display iOS synced tabs or vice versa, tabs from both devices appear in about:sync so the tabs from both devices sync to the server. I'm going to investigate why the the desktop tabs don't show up in iOS and report back.

Looking at the logs, we see:

1667546053493 Sync.RemoteTabs INFO Final tab list has 0 clients with 0 tabs.

I suspect the problem will be that desktop is assuming the fxa-device doesn't exist - maybe because it hasn't hit the /devices end-point recently. IIRC, one way to force that end-point is to use the hamburger menu and select "send tab to device" - that should force a poll for new devices - and then forcing a sync. If the device's tabs then appear, I suspect that will be the problem - that desktop is assuming the tabs record is for an old, stale disconnected device.

I noticed that while the new iOS client data doesn't appear in about:sync a new FxA device record does. I've stepped through the code that uploads the iOS client record and it does get called, but I haven't yet seen what's preventing it from being successful. I have a suspicion that this is related to the update made during the iOS tabs integration to identify client records via FxA device ID rather than the native client GUID, but I'll need to do more digging to be sure. I don't think this can explain synced tabs not showing up in both desktop and iOS but it might make the send tab to device hack work.

A little more detail that nobody asked for . . . after executing the STRs, the call that pulls all the client records from the server returns an array which includes the iOS client from the first sign in, the iOS client from the second sign in, but no desktop client record, which is odd.

Also, the iOS call to upload the updated local client record is executed during the sync after the second login and the success message is logged, however that updated client record never makes it to the server.

Lastly if I stop the xcode simulator (which I'm using in place of an iOS device) and re-run it without removing the app data, this issue resolves itself so maybe this is an app caching issue/stale app state issue of some sort. I've hit my end of day but I'll continue on tomorrow.

QA Whiteboard: [qa-regression-triage]

Mark was able to identify the issue. The sync auth state of the first account wasn't invalidated during sign out. This was an issue with the native iOS sync code. I was able to verify the fix Mark suggested and have created a PR with the fix in the iOS repo.

https://github.com/mozilla-mobile/firefox-ios/pull/12358 has merged, so I'm setting this status to MOVED - I'm not sure what next iOS build it will be in for QA to test though - I'm assuming the next test-flight.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: