etesync / etesync-dav

This is a CalDAV and CardDAV adapter for EteSync
https://www.etesync.com
GNU General Public License v3.0
293 stars 49 forks source link

Android / MacOS and Labels / Groups #233

Open Xeboc opened 3 years ago

Xeboc commented 3 years ago

I'm finding inconsistent transfer of labels and groups between Android and Apple:

I suspect a race condition in the Android app. I've seen Android contacts storage be buggy in places before. Perhaps a slight delay in the addition of objects to the contact store might help? Or maybe the label needs added before the contact, or visa versa? Or even a verification step after the addition of the object to the store? Just a theory.

In the Apple logs for the AddressBookSourceSync process, I'm seeing some 'could not parse vCard' and 'Ignored vCard because it is an unsupported vCard version'. I suspect this is related to #66.

Nothing looks odd in the raw log history, this looks more like OS gotchas.

Android 11, MacOS 11.6 Big Sur

Xeboc commented 3 years ago

Also, as I'm looking at the items in Evolution, I'm seeing the group objects, but none of the contacts are tied to them, and they aren't listed as a category as they currently are in a Google contacts sync.

Contacts syncing is a mess between the ecosystems! Thank you for your work on this project!

tasn commented 3 years ago

Interesting. Yeah, contact syncing can be a mess, it also doesn't help that Apple is vCard 3 and EteSync prefers vCard 4 so we end up having to translate between versions.

I suspect what's going on is that we create vcard 4.0 groups on Android which are unsupported on Apple so they don't show. Though Apple creates groups using labels which Android knows how to handle.

Not sure about the race condition with "Adding a group and contact at the same time on Apple creates both on Android, but the contact doesn't always have the label." The "Empty groups in Apple don't transfer to Android labels." is a bit easier to guess: I think (as said above) that Apple uses labels. Without a contact actually having this label there's nothing to sync to EteSync so it doesn't show on Android.

The best way to figure out what's going on is to look at the EteSync changelog (you can view it from the web or android app) and see what are the actual vcards created and what they contain.

In summary: I think it's a problem with the translation of groups between vcard 3 and 4.

Xeboc commented 3 years ago

It sounds like the work-around is to make the Groups in Apple so they get translated correctly as Labels in Android. Do the object get created as v3 on Apple? Or is it translated from v3 to v4 before storage?

The contact and group both show up in the change history in EteSync on Android. Android doesn't seem to want to make label, make the contact, and apply the label at the same time. I was thinking race condition in that the label isn't created by the time it tries to apply it to the contact, or it is created in the wrong order. It can be worked around, no probably not super important, just a tick.

Any thoughts about Evolution? I'm using the package from the PPA. I see the contact groups as individual items along with the contacts, but they aren't connected in any meaningful ways and they don't show up as Categories. Adjusting categories doesn't seem to propagate at all.