Closed Bug 1692760 Opened 3 years ago Closed 2 years ago

Sync the contact photo via CardDAV

Categories

(Thunderbird :: Address Book, enhancement)

Thunderbird 87
enhancement

Tracking

(thunderbird102+ fixed, thunderbird103 affected)

RESOLVED FIXED
103 Branch
Tracking Status
thunderbird102 + fixed
thunderbird103 --- affected

People

(Reporter: ak.bugzilla, Assigned: darktrojan)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.68

Steps to reproduce:

I have some contacts with contact photos stored in a CardDAV directory. I synced these contacts to Thunderbird using the built-in CardDAV address book.

Actual results:

The contacts were synced to the Thunderbird address book. However, the contact photos aren't shown.

Expected results:

Thunderbird should also sync the contact photos (the TBSync add-on does this).

Does sync to/from server work when contacts are added/removed/edited ?

Thunderbird version 91.1.0

  1. Add contact without photo on some device synchronized with CardDAV service
  2. After sync get this contact in TB address book which is connected with same CardDAV service
  3. In TB address book edit the contact, add photo and press Ok in Photo tab

Actual results:
See standard (empty) photo when navigate to this contact in TB address book

Additional information:

  • If add photo to another contact in TB local address book then see the photo in contact view.
  • If you try to export CardDAV address book with existing contacts with photos in TB and save it as vcard format then you don't see photos in the vcard file

So it looks like current version of address book in Thunderbird does not support export for photos in vcard (and may be it's connected with CardDAV issue).

Thunderbird 91.4.1 on Debian. Baikal 0.8.0.

Both above issues confirmed :

  • Connect TH to CardDAV Baikal Server : contacts are retrieved, but no contact photo.
  • Adding photo to contact manually (file from PC) : photo not saved after TH restart.

Sync works well with "Tbsync" & "Provider for CalDAV & CardDAV" extensions, contacts pictures are retrieved as expected.

It looks more like a bug than an enhancement.

I can confirm that adding a photo via the Thunderbird address book interface for a CardDAV server does not actually edit the VCF. Here are the details:

OS: Gentoo Linux
Thunderbird 91.6.0 (64-bit)
CardDAV: Baikal / sabre-dav (self-hosted)

Thunderbird will pull all contacts from my CardDAV server, and changes are synced accordingly. However, if I add a photo to a contact via Thunderbird, it is not actually modifying the VCF before sending it to the server. My test was to add a ~50KiB photo from my local machine. After adding it, the debugging console shows that the VCF is still ~1.5KiB instead of having the larger file size. This is also confirmed server side by the length of the PUT command in the Apache logs.

I agree that this is a bug and not an RFE.

Further details provided in 1739904:
https://bugzilla.mozilla.org/show_bug.cgi?id=1739904

Yes, this isn't implemented. But we are currently working on it among other things. I'm duping the bugs to this one since they all have the same root cause.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Thank you, Geoff, for cleaning up some of the duplicates. If anything further is needed from my side, please let me know and I will be happy to provide details or tests.

See Also: → 1739901
See Also: 1739901

This has now been implemented but there are a few minor problems preventing it from working. I'm looking at them now.

Assignee: nobody → geoff
Status: NEW → ASSIGNED

… and then tell it otherwise in all of the cases we use.

Version 4 of vCard requires the first component to be VERSION:4.0, this isn't a requirement in version 3, so if no version entry is present, we can assume version 3.
However we want to create version 4 in most cases so we should specify the version and add the component ASAP.

Google's CardDAV server talks vCard 3, and if a contact with a photo is sent to it in another format, the photo is discarded.

In this patch we'll add a new value to servers that we know only use vCard 3, and fix the formatting of the photo for those servers.

Depends on D147831

That turned out to be a lot more complicated than expected. All that was stopping the existing code working for most servers was the fact that I renamed a function in between writing some code that uses the function, and landing that code. But then I tested it with a Google address book, and surprise surprise, they do something weird requiring a whole bunch of other changes.

Thank you for the work so far, Geoff! I'm currently using Baïkal, which is based on Sabre:
https://sabre.io/dav/

It looks like it supports vCard 2.1, 3.0, 4.0, and jCard. With your current patch, will syncing with Thunderbird force the usage of vCard 3.0?

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/b0ee7950c9c7
Make VCardProperties use vCard 3.0 unless told otherwise. r=mkmelin
https://hg.mozilla.org/comm-central/rev/9bc838e8f9a1
Use vCard 3.0 for contacts to be sent to Google via CardDAV. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

(In reply to Nathan Zachary from comment #15)

With your current patch, will syncing with Thunderbird force the usage of vCard 3.0?

No. That will only happen for Google servers, or if you tell it to by creating a preference.

Target Milestone: --- → 103 Branch

Thank you again for your work and your diligence here, Geoff. I greatly appreciate the help in getting contact photos to sync!

(In reply to Geoff Lankow (:darktrojan) from comment #17)

No. That will only happen for Google servers, or if you tell it to by creating a preference.

For anyone reading in the future, that pref would be like ldap_2.servers.<whatever>.carddav.vcard3

Comment on attachment 9279046 [details]
Bug 1692760 - Make VCardProperties use vCard 3.0 unless told otherwise. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: photos won't sync with Google contacts
Testing completed (on c-c, etc.): landed over a week ago
Risk to taking this patch (and alternatives if risky): low

Attachment #9279046 - Flags: approval-comm-beta?

Comment on attachment 9279047 [details]
Bug 1692760 - Use vCard 3.0 for contacts to be sent to Google via CardDAV. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: photos can't be saved to any CardDAV book
Testing completed (on c-c, etc.): landed over a week ago
Risk to taking this patch (and alternatives if risky): low

Attachment #9279047 - Flags: approval-comm-beta?

Comment on attachment 9279047 [details]
Bug 1692760 - Use vCard 3.0 for contacts to be sent to Google via CardDAV. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9279047 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9279046 [details]
Bug 1692760 - Make VCardProperties use vCard 3.0 unless told otherwise. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9279046 - Flags: approval-comm-beta? → approval-comm-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: