nextcloud / nextcloud/contacts

Contact photos are not synchronised anymore, escaped comma

Open
#1,919 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
JavaScript
Stars
642
Forks
220
Avg merge
14h 39m
Merged PRs (30d)
51

Description

Expected behavior

If you synchronize your Nextcloud contacts using e.g. DAVx5 (Android), all contact entities should be synchronized, including an available contact photo.

Current behavior

If you synchronize your Nextcloud contacts using e.g. DAVx5 (Android), all contact entities, except the contact photo, is synchronized.

Steps to reproduce

  1. Create a new contact using the Nextcloud contacts app and add a contact photo.
  2. Synchronize the contact data to a mobile phone using e.g. DAVx5.
    => Result: All contact data is synchronized except the contact photo.

The problem has already been addressed in the DAVx5 support forum (https://forums.bitfire.at/topic/2403/contact-photo-not-syncronized-anymore) and thanks to @rfc2822 (DAVx5 developer) the root cause of the problem might have already been identified. A DAVx5 debug trace showed that the photo entity of the previously created contact contains an escaped comma behind the encoding (base64), although https://tools.ietf.org/html/rfc6350#section-6.2.4 says that escaping isn't valid at this position.

Excerpt from the DAVx5 debug trace which shows how the data is transmitted to DAVx5:

BEGIN:VCARD
VERSION:4.0
PRODID:-//Nextcloud Contacts v3.4.1
UID:bfa39158-7365-489a-8e2e-871d732d2336
...
PHOTO:data:image/jpeg;base64\,/9j/4AAQSkZJRgABAgAAAQABAAD/7QCcUGhvdG9zaG9wI
 DMuMAA4QklNBAQAAAAAAIAcAmcAFHR3akdfV3JpZ0FIWmZTRkdtaTMyHAIoAGJGQk1EMDEwMDBh
 YmYw ...

I'm not sure if it is of importance but if the previously created contact record is downloaded, using the Nextcloud Contacts app, the created vcf file syntax seems to be ok:

Excerpt from the downloaded vcf file:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.3.0//EN
UID:bfa39158-7365-489a-8e2e-871d732d2336
...
PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAgAAAQABAAD/7QCcUGhvdG9zaG9wIDMu
 MAA4QklNBAQ

CC @skjnldsv

Environment

Server Configuration

OS: Linux 4.9.218
Web server: Apache2 2.4.46
Database: MariaDB 10.2.24
PHP version: 7.4.10
Nextcloud version: 19.0.4
Nextcloud contacts app version: 3.4.1

Client Configuration (PC)

Browser: Mozilla Firefox 82.0
Operating system: Windows 10

Client Configuration (Android)

DAVx5 version: 3.3.5-gplay

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how contact photos are serialized for CardDAV synchronization, using the reproduction steps and DAVx5 trace as the expected failure case. Verify the generated vCard photo value against the RFC 6350 format and the downloaded vCard example; done means DAVx5 synchronizes the contact photo without the escaped comma.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.