Repeatedly setting up Sync on the same profile causes unintentional changes

UNCONFIRMED
Unassigned

Status

Cloud Services
Firefox Sync: Backend
UNCONFIRMED
6 years ago
5 years ago

People

(Reporter: Mayank Bansal, Unassigned)

Tracking

({qawanted})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sync:scale])

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0
Build ID: 20121021115746

Steps to reproduce:

I have two systems A and B.
A has FF16. This is my primary browser. It is in use since FF4.
B has nightly. Only for testing etc.

The FF16 is synced to the mozilla server.  I am not sure what sync setting i did, because there is no way i can tell what my current setting is. Anyway, i think its sync from browser to server.

The nightly is not synced till now. Today i tried to sync it with the server, with setting "replace browser data with sync" . So this should not affect the sync data currently on the server. It synced, and i disabled a addon (which is enabled in FF16).




Actual results:

This should not have changed the data on the sync server. But when i opened FF16, and it did its usual sync, the same addon was disabled.


Expected results:

Data on sync server should not have changed if the new device setting is "replace browser data with sync data"

This has happened to me some time back also, but i have reported this today.

Updated

6 years ago
Component: Untriaged → Firefox Sync: Backend
Product: Firefox → Mozilla Services
Version: 19 Branch → unspecified
(Reporter)

Comment 1

6 years ago
more coherent summary : I have an existing device with sync data.

Adding a new device, with preference "replace device data with sync data" , changes the sync data . But it should not.

Specifically, disabling a add-on(adblock plus) in the new device, disabled the same addon in the existing sync data also.
What more information can i provide to help with this bug ?

Comment 2

6 years ago
It seems like we have steps to reproduce.

Tracy, et al: could we try to reproduce and get some sync logs to back it up?
Keywords: qawanted
(Reporter)

Comment 3

6 years ago
I set up two instances of Nightly on different machines (win7 and win8).


1. In the win7 machine i installed some addons, did some browsing etc to create a profile.
2. Then i created a new sync on this machine, with setting : merge server and device data.

3. Install  nightly on win8 machine.
4. Added this win8 machine to existing sync  with setting :   replace device data with sync data.

5. Allow to sync.
6. Disable a few addons in win8 machine.
7.Sync win8 machine again.
8. Go to win7 machine . Sync it.
9. Observe that the win7 machine has those same addons disabled , which were disabled on the win8 machine.

Comment 4

6 years ago
Sync synchronizes the disabled state of an add-on. Comment #3 implies Sync is working as expected.

If you want to change this behavior, you can set the preference "services.sync.addons.ignoreUserEnabledChanges" to "true" to cause Sync to ignore changes to the enbabled/disabled state. You'll have to set this pref on every Sync-connected profile.
(Reporter)

Comment 5

6 years ago
Is the disabled state of addon supposed to be updated in the server (ie. state is updated *from* device *to* server) when the sync method is "replace device data with sync data " ?

That is whats happening here.
(In reply to mayankleoboy1 from comment #5)
> Is the disabled state of addon supposed to be updated in the server (ie.
> state is updated *from* device *to* server) when the sync method is "replace
> device data with sync data " ?
> 
> That is whats happening here.

I think you're misunderstanding the Sync Options setting during setup.

That option dictates what happens on the first sync: whether we first wipe this device, first wipe the other devices, or allow all data to be merged.

This choice allows you to set up an existing device to be the same as your others, or set up an existing device and make the others like that one.

It does *not* make Sync permanently uni-directional. After you complete setup, Sync keeps all devices in sync.

If you set up Sync between two machines, and *then* make changes, those changes will always propagate to the other devices linked to your account.
(Reporter)

Comment 7

6 years ago
Thanks for the clarification! 

I raised this bug because i have some problem in syncing my various installations. I use one installation 90% of the time, and keep adding/deleting/rearranging bookmarks in that.
When i use the secondary nightly, usually only once a month, and sync it, i find that the primary installation gets quite messed up. All the old 1 month old cruft from the secondary gets added to the primary. AFAIUI, the sync would have a timestamp or something to ensure that only the latest is propagated on all devices. 

But i usully find that the older data gets *added*  to the primary current data, instead of getting *merged*, and hence getting discarded due to older timestamp. Like :

1. Deleted in primary - but present in secondary- bookmarks get restored in primary.
2. Bookmarkas present in both, are duplicated in the primary
3. Logins of sites-which werent there in secondary- get erased in primary as well.

and so on.
(In reply to mayankleoboy1 from comment #7)

> When i use the secondary nightly, usually only once a month, and sync it, i
> find that the primary installation gets quite messed up. All the old 1 month
> old cruft from the secondary gets added to the primary. AFAIUI, the sync
> would have a timestamp or something to ensure that only the latest is
> propagated on all devices. 

That's the case.


> 1. Deleted in primary - but present in secondary- bookmarks get restored in
> primary.
> 2. Bookmarkas present in both, are duplicated in the primary
> 3. Logins of sites-which werent there in secondary- get erased in primary as
> well.

Is the clock on your second machine correct? What you're describing sounds exactly like your secondary machine has a clock that's way in the future, or at least way in the future compared to your Sync server. E.g.,

   A: modify bookmark at time 1000_A.
   A: sync. Server record is now at time 1010_S.
   B: last synced at time 500_S, local record modified 2000_B.
   B: downloads that bookmark. Compares server 1010_S to local 2000_B.
   B: rejects remote modification, uploads local record to correct the world. Server modified is now time 1050_S.
   A: syncs. Server record is modified later (1050_S vs local 1000_A), so it applies the server record.

You can see how the clock drift between the two clients can result in miscomparison.

So: are you using NTP on both machines? Does one have a dead battery?
(Reporter)

Comment 9

6 years ago
Both the machines have same timings. No dead battery.

Though one is on win7. The other is on Ubuntu 12.04. Another is on Win8. Another is on Ubuntu 11.04. Another on win7.  All are x64.
This multitude of OS *shouldnt* cause any problems. If possible, can you check ?
(In reply to mayankleoboy1 from comment #9)
> Both the machines have same timings. No dead battery.
> 
> Though one is on win7. The other is on Ubuntu 12.04. Another is on Win8.
> Another is on Ubuntu 11.04. Another on win7.  All are x64.
> This multitude of OS *shouldnt* cause any problems. If possible, can you
> check ?

Sync is cross-platform.

So which one of your five machines causes the problem?

Can you get TRACE-level bookmark Sync logs on machine A, machine B, then machine A again?
Flags: needinfo?(mayankleoboy1)
(Reporter)

Comment 11

6 years ago
Usually the linux ones. But even win7 one had had errors. In fact, this is the reason i disabled sync on all machines (except primary) , and whenever i want to use them, i do a reset sync + "replace device data with sync data".

>Can you get TRACE-level bookmark Sync logs on machine A, machine B, then machine A again?

just tell me how.
Flags: needinfo?(mayankleoboy1)
(In reply to mayankleoboy1 from comment #11)
> Usually the linux ones. But even win7 one had had errors. In fact, this is
> the reason i disabled sync on all machines (except primary) , and whenever i
> want to use them, i do a reset sync + "replace device data with sync data".

Perhaps we should back up a bit.

So, rather than "I have two systems... When i use the secondary nightly, usually only once a month, and sync it, i find that the primary installation gets quite messed up.", you actually have 5 systems, and use Reset Sync every time you use them?

Is there anything else you haven't mentioned?

 
> >Can you get TRACE-level bookmark Sync logs on machine A, machine B, then machine A again?
> 
> just tell me how.

In addition to the steps here:

  https://philikon.wordpress.com/2011/06/13/how-to-file-a-good-sync-bug/

set 

  services.sync.log.logger.engine.bookmarks

to "Trace" (with a capital T). Restart Firefox after changing this.

Thanks!
(Reporter)

Comment 13

6 years ago
There are 2 machines. Machine 1 has win7 and ubuntu 11.04.
Machine2 has win7,win8 and ubunt12.04.
All 5 installations are a mix of release FF and Nightly.

I had a common sync some time back (few months). But i got fed up of the sync issues, which used to mess up my primary installation(win7). I would do a reset sync + "replace device data with sync data" on secondary, in the hope that the secondary installations would always remain downstream from the sync data.

But eventually i disabled the sync on all the secondary installations. Currently, whenever i want to use my secondary installations, i do a create sync + replace device data with sync data on them. After it syncs,I disable sync. And repeat this process everytime i have to use the secondary.
(In reply to mayankleoboy1 from comment #13)

> I had a common sync some time back (few months). But i got fed up of the
> sync issues, which used to mess up my primary installation(win7). I would do
> a reset sync + "replace device data with sync data" on secondary, in the
> hope that the secondary installations would always remain downstream from
> the sync data.

I suspect that what you're seeing is exactly the same as whatever problem that caused you to disable Sync in the first place -- a Reset Sync is just a local wipe followed by a sync.

> But eventually i disabled the sync on all the secondary installations.
> Currently, whenever i want to use my secondary installations, i do a create
> sync + replace device data with sync data on them. After it syncs,I disable
> sync. And repeat this process everytime i have to use the secondary.

OK, so you're constantly setting up and deactivating Sync on the same profile. That ought to work, at the cost of tremendous inefficiency.

Would you agree with the following steps to attempt to reproduce?

* Set up Sync on Win 7 with a full profile.
* Pair another desktop.
* Wait until Sync finishes, then unpair that device.
* Make changes -- bookmark additions, moves, deletes; password changes and deletions -- on the first machine over the course of a month.
* Re-pair that other desktop, choosing "Replace data on this device".
* Wait for Sync to finish, then unpair.
* Sync original machine, observe changes.
(Reporter)

Comment 15

6 years ago
will do.
(Reporter)

Comment 16

6 years ago
(In reply to Richard Newman [:rnewman] from comment #6)
> (In reply to mayankleoboy1 from comment #5)
> > Is the disabled state of addon supposed to be updated in the server (ie.
> > state is updated *from* device *to* server) when the sync method is "replace
> > device data with sync data " ?
> > 
> > That is whats happening here.
> 
> I think you're misunderstanding the Sync Options setting during setup.
> 
> That option dictates what happens on the first sync: whether we first wipe
> this device, first wipe the other devices, or allow all data to be merged.
> 
> This choice allows you to set up an existing device to be the same as your
> others, or set up an existing device and make the others like that one.
> 
> It does *not* make Sync permanently uni-directional. After you complete
> setup, Sync keeps all devices in sync.
> 
> If you set up Sync between two machines, and *then* make changes, those
> changes will always propagate to the other devices linked to your account.


In view of this comment, can you please close https://bugzilla.mozilla.org/show_bug.cgi?id=807227
Summary: Syncing from server to Nightly changes sync in firefox → Repeatedly setting up Sync on the same profile causes unintentional changes
Whiteboard: [sync:scale]
You need to log in before you can comment on or make changes to this bug.