Bug 317767 - owncloud syncing fails if contact contains messenger information
Summary: owncloud syncing fails if contact contains messenger information
Status: RESOLVED DUPLICATE of bug 317966
Alias: None
Product: kdepimlibs
Classification: Applications
Component: kabc (show other bugs)
Version: 4.10
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 07:40 UTC by m.wege
Modified: 2013-04-22 20:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description m.wege 2013-04-03 07:40:32 UTC
I am running KDE 4.10.1 and I am using the DAV-groupware-resource to sync my contacts with Owncloud. Unfortunately syncing fails if I add messenger (tried with Skype and ICQ) information to the contact. I then receive a notification that the element remains unchanged because an error occured the information on the server remains unchanged.
I believe the problem must be in KDE since I can sync contacts from Android to Owncloud which contain messenger information without a problem.

Reproducible: Always
Comment 1 Grégory Oestreicher 2013-04-03 11:46:49 UTC
I've changed a bit the contacts export for 4.10.2, could you test once it's available for you?

Thanks,
Grégory
Comment 2 m.wege 2013-04-05 12:13:01 UTC
Just installed the new version: The problem still exits, the behaviour has only changed in that way that the entries which should be uploaded disappear and can not be changed (remove the messenger entry). This should be changed back, so that in case of other syncing problems, they not synced ones can be retrieved.
Comment 3 m.wege 2013-04-05 16:31:39 UTC
What is specificly bad now if that from time to time it tries again and gives an annoying notification when it fails. I do not know how to stop it.
Comment 4 m.wege 2013-04-05 16:32:30 UTC
Changing status
Comment 5 Bernhard Scheirle 2013-04-06 13:58:13 UTC
Running: Kubuntu 12.10 with KDE 4.10.2
Owncloud: 5.0

1. Create a new contact (with an IM entry) in an ownCloud synced address book.
This contact gets uploaded (no error, no warning). 
But on the webinterface of ownCloud there is no IM entry visible (in the mySQL Database it is, ownCloud bug?)
2. Resync your local address book .
The contact gets deleted! (local)
Comment 6 m.wege 2013-04-06 14:07:36 UTC
(In reply to comment #5)

> 1. Create a new contact (with an IM entry) in an ownCloud synced address
> book.
> This contact gets uploaded (no error, no warning). 
> But on the webinterface of ownCloud there is no IM entry visible (in the
> mySQL Database it is, ownCloud bug?)
> 2. Resync your local address book .
> The contact gets deleted! (local)
Where this meant as instructions for me? Or what? Because in my case the contact containing messenger addresses are newer uploaded when coming from KDE. It works however when comming from Android.
Comment 7 Bernhard Scheirle 2013-04-06 14:13:58 UTC
(In reply to comment #6)
> Where this meant as instructions for me? Or what?
No, this is just my experience with 'contacts containing messenger information' and ownCloud
Comment 8 Grégory Oestreicher 2013-04-06 15:28:07 UTC
OK, there are multiple issues it seems here.

First, the resource assumes that a PUT response will always contain an ETag. After a quick read of the relevant RFCs this is optimistic, and ownCloud includes an invalid one that's used by the resource in subsequent calls. I can fix this by re-fetching modified items unconditionally.

Then there's the issue of the way the IM address is stored. In the item payload it's done via a special property that's not displayed in the ownCloud web interface. Eventually KABC should be fixed if there's a standard property that can be used.
Comment 9 Grégory Oestreicher 2013-04-06 15:30:09 UTC
(In reply to comment #5)
> The contact gets deleted! (local)

Yeah, something worth investigating. With the upcoming fix the contact no longer gets deleted. In the meantime restarting the resource makes it appear again. It may be a side effect of the ETag issue.
Comment 10 Grégory Oestreicher 2013-04-06 15:35:21 UTC
Git commit d8dd647f94b09816c1646bb2b77eafff48402341 by Grégory Oestreicher.
Committed on 06/04/2013 at 17:33.
Pushed by goestreicher into branch 'KDE/4.10'.

Alway refresh items after a PUT to get their ETag
Apparently the ETag in the headers is not 100% reliable
and is not even mandatory.
FIXED-IN: 4.10.3

M  +3    -22   resources/dav/common/davitemcreatejob.cpp
M  +6    -22   resources/dav/common/davitemmodifyjob.cpp

http://commits.kde.org/kdepim-runtime/d8dd647f94b09816c1646bb2b77eafff48402341
Comment 11 m.wege 2013-04-06 15:41:05 UTC
Thanks! Is there any easy way (step to step instruction) to build a fixed package? (Advantage: I could test, if it really works before release :-)
Comment 12 Grégory Oestreicher 2013-04-07 07:45:12 UTC
(In reply to comment #11)
> Thanks! Is there any easy way (step to step instruction) to build a fixed
> package? (Advantage: I could test, if it really works before release :-)

Thanks for your proposal. First you'll need the kdepimlibs-dev package. Then the following should do the trick, from a directory of your choosing:

git clone git://anongit.kde.org/kdepim-runtime.git
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ../kdepim-runtime
cd resources/dav/
make
sudo make install
Comment 13 m.wege 2013-04-10 06:03:55 UTC
I tried this, unfortunately I get:

"-- The following REQUIRED packages have not been found:

 * Akonadi (required version >= 1.9.51) , Akonadi server libraries , <http://pim.kde.org/akonadi>
   Access to PIM storage and services"
I have Akonadi installed, but an older version (the one which comes with 4.10.2). Is there a way to circumvent this?
Comment 14 Grégory Oestreicher 2013-04-10 06:08:55 UTC
Ah, I forgot a step, my bad. You're on the master branch, not on 4.10. Do the following after the 'git clone':
git checkout -b 4.10 -t origin/KDE/4.10
Comment 15 m.wege 2013-04-10 06:11:51 UTC
git checkout -b 4.10 -t origin/KDE/4.10
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Comment 16 m.wege 2013-04-10 07:15:16 UTC
It appears to be working now :-) Thanks!
Comment 17 m.wege 2013-04-10 10:59:08 UTC
ok, unfortunately appears is the right word. I have two laptops which sync the same address book to KDE from owncloud. One of the runs the KDE 4.10.2 package from the sync client, the other one the package which I have compiled from your instructions.
The one which I have compiled from your instructions. The later one shows the contact showing the messenger information which missed before. But the 4.10.2 package shows more contacts. Is it difficult to find out which the exact reasons are:
- It is missing a contact with an identical lastname
- It is missing 4 out of 8 contacts with the same name
- It appears to be missing contacts which just contain the name, nothing more.
- Contacts which have set to have Preferedtextformat set, have this information resynced into "custom-fields" and the information is missing in its original place.
- the name contains a German umlaut, which might be a helpful information
- one of the missing contacts has a "&" in the organisation field, also might be helpful.
In another example-search:
- one of the missing contacts has "Name of the spouse"-field synced to own-fields as X-SPOUSENAME
- It seems like in general contacts with the full identical name are not synced anymore.
I release that this might be a new bug or even bugs, but since this fixed revealed or caused them, I thought it might make sense to start here.
Comment 18 Grégory Oestreicher 2013-04-10 21:56:20 UTC
Just so that we're on the same page, could you update your local clone of the repo? I fixed a lot of things and before starting to work on this I want to be sure that it's still here.

To do it just do:
cd /wherever/kdepim-runtime
git checkout 4.10
git pull
cd ../build
make
sudo make install

Thanks,
Grégory
Comment 19 m.wege 2013-04-10 22:03:33 UTC
I guess it makes sense to use cd resources/dav/ als above? Otherwise it appears to build much more.
Comment 20 Grégory Oestreicher 2013-04-10 22:04:49 UTC
Oh damn, you're right, thanks for being more alert than I :)
Comment 21 m.wege 2013-04-10 22:20:38 UTC
Ok, something changed. It shows more contacts, but not all. Unfortunately I have to compare it with owncloud directly, because my second laptop with 4.10.2 (Ubuntu Raring) without compiled package received an upgerade which appears to have contained your earlies fixes.
Comparing with owncloud:
- Duplicate Full names are still not shown. Although the criteria may not be the fact that they are duplicate, but that they only contain name + picture (the origin of these is are Facebook-contacts from Android).
- MAILPREFEREDFORMATING, BLOGFEED, Y-SPOUSENAME, X-IMADRESS appear as custom headers, but appart from X-SPOUSENAME the information is also displayed where it should be.
Generally it has improved :-)
Comment 22 Thomas Tanghus 2013-04-10 23:34:41 UTC
(In reply to comment #8)
> After a quick read of the relevant RFCs this is optimistic, and ownCloud
> includes an invalid one that's used by the resource in subsequent calls. 

FWIW the invalid ETag issue has been fixed for oC 5.0.4 by not returning anything on creation as the vCard may be altered in the process. Subsequent requests will return a correct ETag.
Sorry for the trouble it may have caused.

And thanks for giving me my contacts back Grégory :)
Comment 23 m.wege 2013-04-12 06:29:00 UTC
Please let me know if there is anything new to test.
Comment 24 Grégory Oestreicher 2013-04-12 06:34:52 UTC
(In reply to comment #23)
> Please let me know if there is anything new to test.

I haven't had time to test yet, so there's nothing new since two days :) I'll be sure to update this report once I have some news or questions.
Comment 25 Grégory Oestreicher 2013-04-22 19:14:32 UTC
Strange, it's not working any better for me (IMADDRESS and SPOUSESNAME are shown only in custom properties), and I have the same issue with a .vcf that I try to import in a local address book. The issue seems to be in KABC, re-assigning.
Comment 26 Bernhard Scheirle 2013-04-22 19:18:43 UTC
(In reply to comment #25)
> Strange, it's not working any better for me (IMADDRESS and SPOUSESNAME are
> shown only in custom properties), and I have the same issue with a .vcf that
> I try to import in a local address book. The issue seems to be in KABC,
> re-assigning.

It is already there, see Bug 317966 - Invalid interpretation of 'X-KADDRESSBOOK-…' (case sensitive?)
Comment 27 Grégory Oestreicher 2013-04-22 19:23:33 UTC
(In reply to comment #26)
> It is already there, see Bug 317966 - Invalid interpretation of
> 'X-KADDRESSBOOK-…' (case sensitive?)

Damn it, you're right, and I even commented in it :)
Closing this one as duplicate.

Regarding your patch I can't evaluate it as I don't know enough KABC to see if there would be side effects. Eventually post it on the kde-pim@kde.org mailing list where more eyes will see it.

*** This bug has been marked as a duplicate of bug 317966 ***
Comment 28 m.wege 2013-04-22 20:12:36 UTC
It appears the duplicate does not include the issue with contacts with the same name are not shown in Kaddressbook mentioned here: https://bugs.kde.org/show_bug.cgi?id=317767#c21
Should I reopen or open a separate bug?