Bug 320022

Summary: kaddressbook silently loses vCard entries when UID is not unique
Product: [Applications] kaddressbook Reporter: Thomas Bleher <ThomasBleher>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: dhit, hpj, montel, tokoe
Priority: NOR    
Version: 4.10   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Test vcard file containung two names with duplicate uids

Description Thomas Bleher 2013-05-19 18:08:09 UTC
I recently tried to load a vCard file where several addresses had an identical UID. KAddressBook seemed to load the file just fine, but several entries were missing. It turned out that the missing entries had a duplicated UID with another field.

I know that this is an error in the file, but it would be very helpful if KAddressBook noticed this error, and printed an appropriate message.

Background: I regularly export my data from KAddressBook via a small script: https://github.com/tbleher/vcard-tools/blob/master/akonadi-to-vcard
I recently tried to re-import the generated vCard file on another computer, and noticed the error there. Apparently, duplicate UIDs are stored in the Akonadi database itself (as far as I could see, when an entry is copied). Now I don't know if this is a bug (because I don't know the internal akonadi format), and certainly the way the script accesses the data is not officially supported, but I thought the issue would still be worth mentioning.

I often export my data

Reproducible: Always

Steps to Reproduce:
1. Load vCard file which contain several entries, where some entries contain duplicate UID

Actual Results:  
Some addresses are missing

Expected Results:  
All addresses are there, or a warning is generated
Comment 1 Laurent Montel 2013-12-06 06:03:30 UTC
could you provide a test case please ?
Comment 2 Thomas Bleher 2013-12-07 09:39:36 UTC
I couldn't reproduce the issue on 4.11.2, so I assume the issue is already fixed.
Comment 3 Thomas Bleher 2013-12-07 09:41:28 UTC
Created attachment 83966 [details]
Test vcard file containung two names with duplicate uids
Comment 4 Christoph Feck 2013-12-15 01:01:00 UTC
Thomas, does the attachment from comment #3 indicate you could still reproduce, in other words, does this need to be reopened?
Comment 5 Thomas Bleher 2013-12-15 14:38:49 UTC
No, this is just the test case I created in response to comment #1. While testing with this file I noticed that I couldn't reproduce the issue anymore. I still uploaded it in case others want to have a look at it.