Bug 342369

Summary: akonadi google contacts5 does not respect <name> <nickname> view
Product: [Frameworks and Libraries] libkgapi Reporter: Philippe ROUBACH <philippe.roubach>
Component: contactsAssignee: Daniel Vrátil <dvratil>
Status: RESOLVED FIXED    
Severity: normal CC: kdepim-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: OpenSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: log when synchronizing kaddressbook and G contacts

Description Philippe ROUBACH 2014-12-31 12:58:20 UTC
opensuse 13.1 x86_64
kde 4.13.3
libkgap2-2 2.2.0-1.1

in kaddressbook i choose to display contacts using "inverted name"
thus for any contacts we have <name> <nickname> and the list is orered by <name> and by <nickname>

if i edit in google contacts a contact then after sync in kaddressbook for this contact we have <nickname> <name> thus the contact is moved at another place in the list 

Reproducible: Always



Expected Results:  
respect the user custom view of the contacts list in kaddressbook
Comment 1 Philippe ROUBACH 2015-01-01 06:54:18 UTC
sorry it is kde 4.14.3
Comment 2 Philippe ROUBACH 2017-03-29 17:11:52 UTC
Created attachment 104801 [details]
log when synchronizing kaddressbook and G contacts

 log when synchronizing kaddressbook and G contacts
Comment 3 Philippe ROUBACH 2017-03-31 09:52:55 UTC
yesterday thre aws an update of KDE Applications to 17.03.

today i experiment there is no more sync problem from G contacts to kaddressbook.

i wait for a week to confirm this.
Comment 4 Philippe ROUBACH 2019-02-16 12:46:17 UTC
kontact 5.10.2
libkgapi 18.12.2

problem still there
Comment 5 Daniel Vrátil 2019-02-21 23:11:55 UTC
Where do you even configure the order in which names are displayed in KAddressbook, I can't actually find it.

Can you check if the values are filled correctly on the Google side?
Comment 6 Philippe ROUBACH 2019-02-22 07:40:12 UTC
>> Where do you even configure the order in which names are displayed in 
>> KAddressbook, I can't actually find it.

in "Contact" tab > Name > Display

>> Can you check if the values are filled correctly on the Google side?


yes Name and Nickname are correctly filled in G contacts

just choose "reverse name" then you see contact changes its place and is displayed as "Name" "Nickname" 
then
sync
then 
again contact is displayed as "Nickname" "Name"

and you get a goodie : photo disappears !
Comment 7 Philippe ROUBACH 2019-02-22 07:58:51 UTC
Other goodies :

- "France" became "FR" !
-
Comment 8 Daniel Vrátil 2019-02-22 09:28:11 UTC
I see - this is an attribute that is stored in the contact itself, very likely gets lost on next sync because Google doesn't support it.

I'll see if we can be more clever about keeping local information during contact sync, only overwrite things that Google actually supports.
Comment 9 Daniel Vrátil 2019-02-22 09:41:39 UTC
Also, let's keep this bug only about the name order, I saw the other reports about photo issues :)

Please report the problem with the country separately.
Comment 10 Philippe ROUBACH 2019-02-22 09:44:56 UTC
also kaddressbook tags are deleted by sync.
Comment 11 Philippe ROUBACH 2019-02-22 09:49:04 UTC
i think generaly a contact item must be a merge of a kaddress contact item and a google contact item. this is a general rule for syncing. sync must not lead to lost.
Comment 12 Daniel Vrátil 2019-02-22 12:01:32 UTC
The problem is that if we keep some data only locally because we cannot sync them to Google, it goes against the principle of Akonadi being only a cache and it can also lead to data loss - if you would delete your Akonadi database, you would lose all this information that we couldn't upload to Google.

We should encode the custom fields that Google does not support out-of-the-box into some "extra" fields that we can sync to Google (but unfortunately no other clients will likely be able to understand them), and eventually have the feature where the Contact Editor would only allow changing fields that the respective backend supports (so if Google does not support Contact name ordering, we would simply not make it configurable when creating a new contact in Google Contacts addressbook).

For now, I'll look into the first step - encoding everything into the extra fields.
Comment 13 Philippe ROUBACH 2019-05-08 17:36:52 UTC
kde plasma 5.15.5
kde framework 5.57.0
qt 5.12.3
kde app 19.04

No more problem. if i choose <name><nickname> then after sync it is still <name><nickname>