Closed Bug 726194 Opened 9 years ago Closed 9 years ago

Sync pairing succeeds, but is OFF and there is no synchronization

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P1)

ARM
Android
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla13

People

(Reporter: mluna, Assigned: rnewman)

Details

(Whiteboard: [inbound])

Attachments

(5 files)

Attached file verbose log from ddms
Using Aurora 2012.02.10 (12.0a2) and Nightly 2012.02.10 (13.0a1), attempted and succeeded in pairing a 2.3 gingerbread device. But Sync is OFF in settings and no data is synched. (Status icon in settings is OFF). Find a verbose log and screenshots attached.
Attached image setup complete message
OS: Mac OS X → Android
Hardware: x86 → ARM
I'll note that the device where the sync was off was still able to accept J-PAKE as a master and transfer credentials to the desktop
OS: Android → Mac OS X
Hardware: ARM → x86
The log shows three completed setup operations. Each time everything succeeds from our perspective:


02-10 14:04:02.903: DEBUG/AccountActivity(2297): Adding account for org.mozilla.firefox_sync
02-10 14:04:02.953: DEBUG/AccountActivity(2297): Account: Account {name=grotuk@gmail.com, type=org.mozilla.firefox_sync} added successfully? true
02-10 14:04:02.953: DEBUG/SyncManager(92): setSyncAutomatically: , provider org.mozilla.fennec_aurora.db.browser -> true
02-10 14:04:03.053: DEBUG/AccountActivity(2297): Finished setting syncables.
02-10 14:04:03.053: INFO/AccountActivity(2297): Clearing preferences for this account.
02-10 14:04:03.053: DEBUG/Utils(2297): Shared preferences: sync.prefs.4tqbja5hwfc3fd52j7irysu3j5p5afw5
02-10 14:04:03.193: DEBUG/SyncManager(92): setSyncAutomatically: already set to true, doing nothing
02-10 14:04:03.413: DEBUG/AccountChangeReceiver(2388): Accounts changed: [] add; [] removed


What do you see if you tap the Firefox Sync account in the Settings window?

Was the device completely clean (all Firefox apps uninstalled) prior to setup, or did the account already exist?

If clean, was the settings app viewing an account with the same email address prior to you installing the new Firefox apps?
OS: Mac OS X → Android
Hardware: x86 → ARM
Summary: sync pairing succeeds, but is OFF and there is no synchronization → Sync pairing succeeds, but is OFF and there is no synchronization
I'm the owner of the device and we can replicate it every time we tried. We were getting screenshots to document the process so Michelle has screenshots and logs if you need more.

Answering your questions:
- If I click the Sync category I'm prompted with the same page as if you are properly synced but there's nothing synced to the device. Just the Pair a Device option.

- We managed to successfully use this device to pair another device. Confirming that is paired but no syncing anything.

- The device had a previous version of Native in Nightly from before Sync was delivered and had a XUL version synced. The first try has been with the XUL version synced. After failing we have removed the sync pairing in the Fx 12.0.a2 and the old XUL version. After removing we tried again and we faced the same behavior.

- I'm not sure if the previous paragraph answers the last question. If you need more detail, let me know.
(In reply to Ibai from comment #5)
> I'm the owner of the device and we can replicate it every time we tried. We
> were getting screenshots to document the process so Michelle has screenshots
> and logs if you need more.

Did you happen to try uninstalling everything Firefox related, rebooting the device, and trying again?

> Answering your questions:
> - If I click the Sync category I'm prompted with the same page as if you are
> properly synced but there's nothing synced to the device. Just the Pair a
> Device option.

Is there a checkbox "Sync Fennec" (or Aurora, or…)?

There should be

=====
Options
=====
  Pair a device
=====
Data & synchronization
=====
  Sync Fennec                  []

If you don't see a checkbox, that implies that the Fennec browser itself isn't installed correctly, but the account is set up correctly. If you do see a checkbox, but it's not checked, then Android is being dumb.
I don't have the whole "Sync Fennec plus Check-box" line at all.

We haven't delete everything but we tried to download Nightly and the same happened.

Should I go ahead and delete everything so I can test it on a purely Firefox free environment? Or do you want to try something to understand what's exactly wrong?
(In reply to Ibai from comment #7)
> I don't have the whole "Sync Fennec plus Check-box" line at all.

It looks like Fennec isn't installed right. Sync seems to be working fine… it just doesn't have anything to sync to!

> We haven't delete everything but we tried to download Nightly and the same
> happened.
> 
> Should I go ahead and delete everything so I can test it on a purely Firefox
> free environment? Or do you want to try something to understand what's
> exactly wrong?

Did you have only one native Firefox installed at a time, or always Nightly *and* Aurora?

If both, what happens if you only have one installed?

Otherwise, go ahead and uninstall everything, see if you can still repro.

(Sorry for the inconvenience!)
In the account setup, when SyncManager sets automatic syncing for the fennec browser content provider, it doesn't do it for the Account that was just added.

02-10 13:57:57.733: DEBUG/SyncManager(92): setSyncAutomatically: , provider org.mozilla.fennec_aurora.db.browser -> true

The Account should be right in front of that dangling comma, when I compare with logs of a successful account setup - I wonder if this is due to some kind of Android timing issues, like in http://stackoverflow.com/questions/7925802/syncadapter-not-being-called-depending-on-order-of-account-setup-calls
(In reply to Chenxia Liu [:liuche] from comment #9)
> In the account setup, when SyncManager sets automatic syncing for the fennec
> browser content provider, it doesn't do it for the Account that was just
> added.

Did I mention I hate Android?
Priority: -- → P1
tracking-fennec: --- → ?
So this is even worst than expected.

I removed all my Firefox Mobile versions, cleaning data first: Release, Aurora and Nightly.

Restarted my phone.

Installed Aurora.

Synced device.

Same old behavior. Device is paired but it doesn't sync.

Any test that you want me to run? We should fix this before shipping.
A complete log post-install would be nice, but right now I don't have any leads other than seeing if it happens on a Nightly build…
I'm unable to reproduce this on Galaxy Tab with Aurora. History and bookmarks sync fine on linking to account.  However, due to bug https://bugzilla.mozilla.org/show_bug.cgi?id=709347  instant sync on desktop is not enabled.  As such, manual syncs are required to get fresh data syncs.
Are your Android Settings for Accounts & Sync > Background Data and Auto Sync selected?
Pictures of the status attached.

Tracy, Galaxy Tab runs 3.2. My phone runs Gingerbread 2.3
Attached image Sync settings
Attached image No devices synced
Ibai:
What Gingerbread 2.3 device do you have?

Maybe we need to add a call to setIsSyncable(). [1] It doesn't explain why syncing works on other devices, but given the other Android bugs, I wouldn't be surprised. There also appears to be a bug with the Motorola bionic with regards to setMasterSyncAutomatically() [2]

[1] - https://github.com/mozilla-services/android-sync/blob/develop/src/main/java/org/mozilla/gecko/sync/setup/activities/AccountActivity.java#L254
[2] - http://community.developer.motorola.com/t5/Android-App-Development-for/Android-API-setMasterSyncAutomatically-does-not-work-on-Motorola/td-p/21950
David, it's an unlocked Nexus One.
(In reply to David Chan [:dchan] from comment #18)
> Ibai:
> What Gingerbread 2.3 device do you have?
> 
> Maybe we need to add a call to setIsSyncable().

I'd be surprised (well, as surprised as it's possible to be, given the horror that is Android). If there's no checkbox, there's no "thing" to mark as syncable. Worth a shot, I guess.

I'd guess that liuche's idea about some kind of timing issue is the root cause.

*sigh*
I've given Ibai a build to test:

http://people.mozilla.com/~rnewman/ibai.apk

Let's see…
I don't know what you have done but it works now.

Kudos!
Assignee: nobody → rnewman
https://hg.mozilla.org/mozilla-central/rev/98c144fa6308
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Michelle or Ibai, can you please verify this bug because I tried and I can't reproduce it even on 02/10 build.

Thanks
It was fixed with the patch provided by Richard.
Status: RESOLVED → VERIFIED
Product: Mozilla Services → Android Background Services
tracking-fennec: ? → ---
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.