• Hello

    I have successfully set up DAVx5 on Sony Xperia 1 to sync my Yandex contacts. However, now I observe the following strange phenomenon.

    I started assigning pictures/icons to my contacts using the Contacts app on my Xperia. Everything seems to work fine at first: the pictures get assigned and displayed properly. However, at some point I noticed that the pictures I assign do not always stick. A number of contacts appear to work as expected: they keep their assigned pictures. But some other contacts only keep their pictures for about 10-20 seconds after assigning and then, right before my eyes they revert back to “no picture” (just initials) icon in the contact list.

    It doesn’t look like a hit a certain limit or something… since even though some contacts are already acting up, some other contact still receive and keep their pictures.

    It doesn’t seem to be associated with the picture: the same picture might work fine with one contact and fail to “stick” to another contact.

    It appears that it is a problem with the contact itself.

    Is this a known issue with Yandex? Or will it require further investigation?

    Thank you

  • admin

    @themortiestmorty Hi! I’ve not tested it in detail, but can you try to scale down a picture and add it to a contact where it originally didn’t work? Maybe the Yandex server does not allow certain image file sizes and removes it on sync - maybe it acts on the size of the vcard that is transmitted. So maybe one vcard is a little bit too big with the same picture than another.

    However I’ve never experienced this behaviour anywhere, not heard from it. So I think it must have something to do with Yandex in this case.


  • I discovered one defining distinction that makes the contacts behave incorrectly: presence of any email address in the contact card.

    If a contact has a email address listed in their contact details, it is impossible to assign a picture to that contact. The symptoms are as described above: the picture seems to assign OK initially, but disappears on the subsequent re-sync.

    If a contact has no email addresses listed in their contact details, the picture can be assigned without any problems. It assigns and sticks.

    If I assign a picture to a contact without an email, and then add a email address later, the picture will be lost on the next re-sync.

    So, how do I debug this? How do I determine who is losing the pictures: DAVx5 or Yandex?

  • developer

    @themortiestmorty You can

    1. enable verbose logging in DAVx⁵,
    2. then set the photo for a contact in the Contacts app,
    3. force sync in DAVx⁵,
    4. wait until the photo is gone,
    5. then share the debug log from the notification to yourself,
    6. (then turn off debug info again).

    In the logs, you can see everything.


  • @rfc2822 Good idea. I’ve just done that. Here’s what happens, according to the log

    For a contact with an email address:

    1. I assign a picture
    2. DAVx5 sends the full updated VCARD (say, YA-127) to the server with picture information in it (as an ‘ENCODING=b’ blob)
    3. On the subsequent re-synch DAVx5 detects that “YA-127 has been changed on server (current ETag=127-152, last known ETag=127-41)”
    4. DAVx5 downloads and updates local VCARD for YA-127. The downloaded VCARD has no picture, which causes DAVx5 to remove the local picture from this entry.

    This is the effect I observed, when a freshly assigned picture disappears by itself 20 seconds later.

    For a contact without an email address:

    1. I assign a picture
    2. DAVx5 sends the full updated VCARD (say, YA-153) to the server with picture information in it (as an ‘ENCODING=b’ blob)
    3. On the subsequent re-synch DAVx5 detects no changes in any VCARDs. ETag for YA-153 remains the same.
    4. DAVx5 does not download and update anything. Local entry for YA-153 keeps its locally assigned picture.

    Now if I go directly to Yandex through a Web browser and edit something minor for YA-153, on the next re-synch DAVx5 will, of course, detect the change, re-download YA-153s VCARD and, as one would expect, this entry will also lose its picture.

    So, the conclusion is as follows: Yandex does not store contact pictures. The pictures are discarded by Yandex servers from all incoming VCARDs. Outgoing VCARDs are served by Yandex servers with no pictures in them. (The strange difference in behavior between contacts with and without email is besides the point.)

    The obvious question here: is there a way to ask DAVx5 to unconditionally keep the locally assigned contact pictures no matter what? I.e. even if an updated VCARD returned by Yandex server has no picture in it, can we still ask DAVx5 to keep the locally assigned one instead of discarding it?

  • admin

    @themortiestmorty Unfortunately you can’t because DAVx5 must maintain a synchronized state with the server, which always wins in case of conflicts. If a server removes the contact picture it has to be synchronized to the device. We can’t alter this information 😕


  • @devvv4ever I understand, but I believe that when it comes to contact pictures specifically, it has always been a popular (de-facto standard?) feature to allow the user to locally override the server-supplied picture with a locally-assigned picture. I remember seeing this option in other DAV applications. Again: only for contact pictures.

    To me this appears to be a rather natural solution to the problem of servers that refuse to store contact pictures. Or am I missing something less obvious?

  • developer

    @themortiestmorty said in Assigning pictures to Yandex contacts:

    To me this appears to be a rather natural solution to the problem of servers that refuse to store contact pictures. Or am I missing something less obvious?

    Before introducing complicated workarounds, I’d ask Yandex first. Maybe this is a known problem and thus will be fixed on the server side soon? Or it’s not known, then maybe they’ll fix it after a report.


  • @rfc2822 said in Assigning pictures to Yandex contacts:

    Before introducing complicated workarounds, I’d ask Yandex first.

    A single boolean flag with “don’t exchange pictures/ignore server-supplied picture” semantics hardly qualifies as a “complicated workaround”. (Basically, “don’t use PHOTO field”.)

    As for asking Yandex… I have. And all I got from them so far is a pair of links: one to their official CardDAV/CalDAV setup page, another - to 4pda.ru forum. Not exactly useful.


    On the subject of complicated workarounds… A complicated workaround would be to store the encoded picture in the NOTE field of the contact card (with some additional markup, of course) and send it to Yandex that way. I tried and it appears that Yandex servers accept it, store it and then serve it back in its unspoiled form. So, that would actually work around Yandex refusal to store PHOTO… until they get wise to it, probably 🙂

Similar topics

  • 2
  • 2
  • 1