Bug 365192 - kaddressbook corrupts or discards information in it does not know (carddav)
Summary: kaddressbook corrupts or discards information in it does not know (carddav)
Status: RESOLVED FIXED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR critical
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-07 11:43 UTC by Erik Quaeghebeur
Modified: 2016-07-08 21:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.3


Attachments
pre-manipulation vcard file (250 bytes, text/vcard)
2016-07-07 21:49 UTC, Erik Quaeghebeur
Details
post-manipulation vcard file (218 bytes, text/vcard)
2016-07-07 21:49 UTC, Erik Quaeghebeur
Details
diff of pre and post vcard files (471 bytes, patch)
2016-07-07 21:50 UTC, Erik Quaeghebeur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2016-07-07 11:43:59 UTC
(Kontact 4.14.10)

When modifying an addressbook contact from a carddav resource that contains fields that are not known to kaddressbook, these fields are silently discarded or corrupted.

Example:
* IMPP and RELATED fields are discarded.
* fields with group syntax (e.g., item1.ADR or davdroid2.ABLABEL) get corrupted, i.e., the group (e.g., item1 or davdroid2) and the period get lost (and also item2.ADR gets thrown away entirely) and sometimes duplication of the first part of the label name (until a dash) happens. Perhaps kadressbook does not know the grouping syntax?

kaddressbook should never touch fields it does not know! Just keep them in the vCard as-is.

Reproducible: Always
Comment 1 Laurent Montel 2016-07-07 12:04:44 UTC
I improved a lot vcard4 support in kf5
but perhaps it"s still not perfect.
could you provide some vcard4 file where info are discarded please ?
I will continue to improve it.

thanks
Comment 2 Erik Quaeghebeur 2016-07-07 21:48:51 UTC
(In reply to Laurent Montel from comment #1)
> I improved a lot vcard4 support in kf5

Please note, this issue is not vcard4-specific.

> could you provide some vcard4 file where info are discarded please ?

Yes, I'll attach test-pre.vcf for the vcard as it was before manipulation in kaddressbook, text-post.vcf after manipulation, and test.vcf.diff to show the changes explicitly. The manipulation consisted of adding the NICKNAME Testy.
Comment 3 Erik Quaeghebeur 2016-07-07 21:49:26 UTC
Created attachment 99933 [details]
pre-manipulation vcard file
Comment 4 Erik Quaeghebeur 2016-07-07 21:49:51 UTC
Created attachment 99934 [details]
post-manipulation vcard file
Comment 5 Erik Quaeghebeur 2016-07-07 21:50:35 UTC
Created attachment 99935 [details]
diff of pre and post vcard files
Comment 6 Laurent Montel 2016-07-08 05:37:06 UTC
(In reply to Erik Quaeghebeur from comment #2)
> (In reply to Laurent Montel from comment #1)
> > I improved a lot vcard4 support in kf5
> 
> Please note, this issue is not vcard4-specific.

Yep I know :)
I fixed some bugs about it in kf5. But perhaps it's not all fixed :)
 
> > could you provide some vcard4 file where info are discarded please ?
> 
> Yes, I'll attach test-pre.vcf for the vcard as it was before manipulation in
> kaddressbook, text-post.vcf after manipulation, and test.vcf.diff to show
> the changes explicitly. The manipulation consisted of adding the NICKNAME
> Testy.

Thanks a lot
Comment 7 Laurent Montel 2016-07-08 06:20:03 UTC
Ok I exclude export RELATED as it's vcard4 support not v3 but ok I will export it too to be sure that no info are lost.
Comment 8 Laurent Montel 2016-07-08 06:34:32 UTC
Git commit 166de982de7d977dfdc10262e63fe2c910943502 by Montel Laurent.
Committed on 08/07/2016 at 05:46.
Pushed by mlaurent into branch 'master'.

Add new autotest from bug 365192

A  +10   -0    autotests/data/vcard15.vcf
A  +10   -0    autotests/data/vcard15.vcf.ref

http://commits.kde.org/kcontacts/166de982de7d977dfdc10262e63fe2c910943502
Comment 9 Laurent Montel 2016-07-08 06:34:32 UTC
Git commit ee98321a1f4ab94726c734fd508bcd54e4fc9c68 by Montel Laurent.
Committed on 08/07/2016 at 06:33.
Pushed by mlaurent into branch 'master'.

Make sure that we don't lose some data. When some server export as vcard3

they export all vcard4 variable too.
So export them too.

M  +4    -3    autotests/data/vcard15.vcf.ref
M  +1    -0    autotests/relatedtest.cpp
M  +0    -2    autotests/testroundtrip.cpp
M  +2    -0    autotests/testroundtrip.qrc
M  +10   -12   src/vcardtool.cpp

http://commits.kde.org/kcontacts/ee98321a1f4ab94726c734fd508bcd54e4fc9c68
Comment 10 Laurent Montel 2016-07-08 06:43:24 UTC
still group support problem. But kcontact support it.
Comment 11 Laurent Montel 2016-07-08 07:00:18 UTC
Git commit ad8892fd98a401ffe9a6aafc3bc0a109da22c7b8 by Montel Laurent.
Committed on 08/07/2016 at 06:56.
Pushed by mlaurent into branch 'master'.

Add autotests for vcardline support. Test group support

M  +1    -0    autotests/CMakeLists.txt
A  +36   -0    autotests/vcardlinetest.cpp     [License: LGPL (v2+)]
A  +35   -0    autotests/vcardlinetest.h     [License: LGPL (v2+)]
M  +3    -1    src/vcardparser/vcardline.h
M  +1    -0    src/vcardparser/vcardparser.cpp
M  +5    -0    src/vcardtool.cpp

http://commits.kde.org/kcontacts/ad8892fd98a401ffe9a6aafc3bc0a109da22c7b8
Comment 12 Laurent Montel 2016-07-08 11:54:26 UTC
Git commit 390166ad96f946554d36bb9296c04cac1fddfa2e by Montel Laurent.
Committed on 08/07/2016 at 11:36.
Pushed by mlaurent into branch 'master'.

Add support for fieldgroup

M  +1    -0    autotests/CMakeLists.txt
A  +261  -0    autotests/fieldgrouptest.cpp     [License: LGPL (v2+)]
A  +46   -0    autotests/fieldgrouptest.h     [License: LGPL (v2+)]
M  +2    -0    src/CMakeLists.txt
M  +29   -0    src/addressee.cpp
M  +7    -0    src/addressee.h
A  +154  -0    src/fieldgroup.cpp     [License: LGPL (v2+)]
A  +76   -0    src/fieldgroup.h     [License: LGPL (v2+)]

http://commits.kde.org/kcontacts/390166ad96f946554d36bb9296c04cac1fddfa2e
Comment 13 Laurent Montel 2016-07-08 11:54:26 UTC
Git commit 5d8492acd0d57a77305b012e2726cc6b0e8eedbe by Montel Laurent.
Committed on 08/07/2016 at 11:52.
Pushed by mlaurent into branch 'master'.

Fix Bug 365192 kaddressbook corrupts or discards information in it does not know (carddav)

Fix group support

FIXED-IN: 5.3

M  +2    -2    autotests/data/vcard15.vcf.ref
M  +0    -1    src/vcardparser/vcardparser.cpp
M  +1    -2    src/vcardtool.cpp

http://commits.kde.org/kcontacts/5d8492acd0d57a77305b012e2726cc6b0e8eedbe
Comment 14 Erik Quaeghebeur 2016-07-08 21:51:45 UTC
(In reply to Laurent Montel from comment #13)
>
> FIXED-IN: 5.3

Thanks for your expedient handling of this issue! I'll keep an eye on the version I get through my distribution and test once it's at 5.3.