We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

How will contacts be updated when Google contacts 2-way sync is enabled?

asked 2014-05-19 08:32:45 +0300

icebox gravatar image

updated 2015-02-23 22:03:52 +0300

Plans for update 7 note the introduction of Google contacts 2-way sync.

What will happen with the contacts if:

  1. A contact has been updated on the phone
  2. A contact has been updated on google contacts
  3. Same contact has been edited both on google contacts and the phone

Thanks

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
3

answered 2014-05-19 08:54:38 +0300

chris.adams gravatar image

The synchronization code is somewhat complex.

You can see most of the implementation at https://github.com/nemomobile/qtcontacts-sqlite/blob/master/src/extensions/twowaycontactsyncadapter_impl.h but note that there is some Google-specific extensions to this code which is used in the actual sync adapter (that code will hopefully be opensourced in the near future).

Basically, when a sync occurs the algorithm is: 1) determine what changes occurred remotely since the last sync (or compared to the sync baseline) 2) apply those changes to the contact in the local database 3) determine what changes occurred locally since the last sync 4) push those changes up to the server.

If a contact is updated on the phone, the changes will be propagated to the server. If a contact has been updated on the server, the changes will be propagated to the phone database. If the same contact is modified on both, the deltas will be inspected and the appropriate changes applied to both. In the case where the same detail is modified both remotely and locally, we currently prefer the local device changes for that detail (this conflict resolution policy is something we're hoping to expose as a setting in the future, however).

Cheers, Chris.

edit flag offensive delete publish link more

Comments

So basically you're saying, relax it will work ok and it will bring everything into agreement on the first sync after the update :) Thank you I had to ask, since I still have nightmares when I first enabled google sync on a symbian phone a few years ago...

icebox ( 2014-05-19 09:02:57 +0300 )edit
3

Yes, please, expose a setting to let the user choose the conflict policy he would like to apply. My choice would have been the opposite (prefer server changes) because I consider that the probability of having corrupted data on my phone is higher than having corrupted data on the server.

Tofe ( 2014-05-19 10:22:57 +0300 )edit

I think this logic should be simplified.

Currently, when you add a contact detail on the phone, and delete that detail on the server, is is magically synchronised back as it "belogs to the phone" as soon as another synchronisation has been executed.

I propose the following approach:

  • When a new contact is created on the phone, you select where this contact should belong to: e.g. one of your Google accounts, the local phone or any other account source like card dav.
  • This is also important if you have multiple Google accounts (e.g. I have a private and company Google account, and I want to separate private contacts from business contacts).
  • The selected source is then the "master". Apart from local contacts, the remote source is always the master. This means than you can add contact details locally on the phone that are synchronised to the server, edited or deleted there and vice versa without strange behaviour due to "detail belongs to phone"
peter.woelflingseder ( 2015-03-05 22:42:21 +0300 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2014-05-19 08:32:45 +0300

Seen: 570 times

Last updated: May 19 '14