Where we're at with CardDAV

389 views
Skip to first unread message

Geoff Lankow

unread,
Aug 26, 2020, 10:04:27 PM8/26/20
to Thunderbird planning

You may already be aware that bits and pieces of CardDAV support have landed in various versions of Thunderbird. This is an appropriate point for me to update you on what Thunderbird can and can't do with regards to CardDAV.

Please note that CardDAV support is NOT considered ready for general use.

Status of ESR, Thunderbird 78:

ESR shipped with the bulk of the pieces in place. Unfortunately there wasn't time to complete the work, and so we're not publicising CardDAV as a feature of 78.

Currently on ESR, CardDAV can connect to a server and download your contacts, and updates you make to contacts will be sent to the server, but there are no synchronisation abilities. The UI to create a CardDAV address book (File – New – CardDAV Address Book in the Address Book window) is hidden behind the preference mail.addr_book.carddav.enabled.

Status of Beta, Thunderbird 81:

CardDAV has the ability to do periodic and on-demand synchronisation with the server. You can right click on an address book in the UI and choose synchronise. Automatic synchronisation happens shortly after Thunderbird starts, and every 30 minutes after that, but there's no control it. The preference still exists.

If you've been trying out earlier versions of the Thunderbird CardDAV implementation, you should remove any directories you created and recreate them. The set-up process now does some things it didn't previously do.

Plan for Daily, Thunderbird 82:

The final pieces of the initial implementation of CardDAV are in review and are going to land any day now. When they do I'll consider this phase complete and remove the preference.

What's been done so far:

The origins of Thunderbird's address book system date back to the 1990s and they're deeply entwined with the rest of the program. They are also not very compatible with many of the features of the vCard format, which is used for the exchange of information between client and server.

A lot of work has gone into modernising Thunderbird's support for vCard. What existed before was the absolute minimum of read/write capabilities for vCard 2.1. vCard 2.1 has since been superseded by vCard 3.0 and 4.0. I have completely replaced Thunderbird's vCard implementation with that of ical.js, which we ship as part of the Thunderbird calendar. Thunderbird can now read and write vCards in versions 3.0 and 4.0, and still (through a variety of hacks) read vCard 2.1.

To translate vCards into objects the rest of Thunderbird understands (nsIAbCard), without completely rewriting everything, I've created utility functions that translate between the two formats. Not all vCard data can be represented in the nsIAbCard format, so I've tried hard to ensure that Thunderbird can use the most relevant information, and that information doesn't get lost when converting back to vCard. (And yes, for those of you who have read the CardDAV documentation, we do store the original vCard and only modify it as necessary.)

Finally we took our base address book storage, added the CardDAV protocol to it, and this is where we are today.

At this point I'd like to thank the various people who have provided access to different types of servers for testing. That's been very helpful. Thank you.

Can I do all of the things CardDAV is capable of, like mark an email address as "home" or "work"?

No. Not only is our current format incapable of handling this information, but there is no user interface to do it with. For all intents and purposes, at this stage, a CardDAV address book behaves just like a normal Thunderbird address book, except that changes are relayed to a remote server and updates are retrieved from the server.

Will I be able to do these things in the future?

Yes. That's the intention anyway, but I haven't got a crystal ball so can't see what the future holds.

By next year's ESR release, we should have a new user interface for the address book. This should be able to do many of the useful things you can do in other address book software, but it will require a lot more work in the background.

Can I use this to connect to my Google contacts?

Not at this stage. As per usual, Google have to be different, and they use OAuth instead of standard HTTP authorisation. The code is written, but we're waiting on Google to allow us to ask you for permission to access your contacts.

How does this affect WebExtensions?

To WebExtensions, a CardDAV address book appears the same as a regular address book, and no modifications are necessary at this point. In the future there may be some additional API functions available, and we'll try to do this in a backwards-compatible way.

Where do I report bugs?

Please use the Mailnews Core – Address Book component to report bugs, unless the bug is in the UI, in which case use Thunderbird – Address Book. Please provide as much information as you can, including the version of Thunderbird you see the problem in, any applicable error messages, and if it's relevant, the server software you're connecting to.

The Network Inspector tool (Tools – Developer Tools – Developer Toolbox, then choose Network) is very useful for debugging problems. If the server reports an error message and Thunderbird fails to handle it appropriately, please file a bug.

Mihovil Stanić

unread,
Aug 27, 2020, 9:12:16 AM8/27/20
to tb-pl...@mozilla.org
Good job Geoff and everyone involved. Glad to see long standing feature requests are getting implemented.
With PGP, CalDAV and new address book in development process future of TB looks rosy (unicorns and rainbows). :)

Hopefully after that, or along with that, we can place more focus on TB speed and responsiveness or perceived speed and responsiveness.

Good job again, keep it up.

Mihovil
_______________________________________________
tb-planning mailing list
tb-pl...@mozilla.org
https://mail.mozilla.org/listinfo/tb-planning

neandr

unread,
Aug 27, 2020, 9:12:36 AM8/27/20
to Thunderbird planning (moderated), Geoff Lankow

A GREAT step to get this long pending requirement available for Thunderbird!

Many thanks for the hard work, and it's good to see the ical.js makes it's way to become a Thunderbird standard!

Günter


Am 27.08.20 um 04:04 schrieb Geoff Lankow:

Ben Bucksch

unread,
Sep 7, 2020, 10:14:37 AM9/7/20
to tb-pl...@mozilla.org
Hi Geoff,

first off, thanks very much for working on this! Reliable cardDAV 2-way sync is my probably number 1 missing feature in Thunderbird for me. It will be important for everyone who doesn't want to share their address book with Google/Apple.


On 27.08.20 04:04, Geoff Lankow wrote:

Not all vCard data can be represented in the nsIAbCard format, so I've tried hard to ensure that Thunderbird can use the most relevant information, and that information doesn't get lost when converting back to vCard. (And yes, for those of you who have read the CardDAV documentation, we do store the original vCard and only modify it as necessary.)


thank you for your diligence in this! Details like that make and break an implementation - or even other clients that synchronize the same AB. I appreciate that you're trying to do this right. Users will never know that your diligence saved their address book, but you will know that you did :).


Status of Beta, Thunderbird 81:

CardDAV has the ability to do periodic and on-demand synchronisation with the server. You can right click on an address book in the UI and choose synchronise. Automatic synchronisation happens shortly after Thunderbird starts, and every 30 minutes after that, but there's no control it. The preference still exists.


Could you tell me what happens at the initial sync? Other sync addons have often assumed at initial sync that one of the sides - e.g. the server -  is authoritative, and have in fact deleted my local address book, or certain entries that are available only in Thunderbird. Do you do a full 2-way sync, even at initial sync?

How are conflicts resolved? Here are some scenarios:

  • Same name, different phone numbers on each side -> either add both numbers on both sides (risky, because one of them might be old and outdated), or ask user (but how would the user know which number or side is correct or the most recent?)
  • Same name, same phone number, but one of the sides has an additional field, like a street address or personal notes or an AIM nickname -> add the missing field to the other side, without asking, or only asking once for all contacts
  • Similar name (E.g. "Eric" vs. "Eric Food"), same phone number -> ask whether to merge, while showing all fields of both sides. Remember the users response, and do not ask again at next sync.
  • Same last name, different first name, same fixed line number, different cell phone numbers -> do not merge, or ask (see previous point)


Where do I report bugs?

Please use the Mailnews Core – Address Book component to report bugs, unless the bug is in the UI, in which case use Thunderbird – Address Book. Please provide as much information as you can, including the version of Thunderbird you see the problem in, any applicable error messages, and if it's relevant, the server software you're connecting to.

The Network Inspector tool (Tools – Developer Tools – Developer Toolbox, then choose Network) is very useful for debugging problems. If the server reports an error message and Thunderbird fails to handle it appropriately, please file a bug.


Great suggestions. I hope that the bug reports contain such useful information.


Geoff Lankow

unread,
Sep 7, 2020, 6:38:26 PM9/7/20
to tb-pl...@mozilla.org
On 08/09/2020 02:14, Ben Bucksch wrote:
> Could you tell me what happens at the initial sync? Other sync addons
> have often assumed at initial sync that one of the sides - e.g. the
> server -  is authoritative, and have in fact deleted my local address
> book, or certain entries that are available only in Thunderbird. Do
> you do a full 2-way sync, even at initial sync?

We don't have an initial sync. A CardDAV address book in Thunderbird
always starts empty and collects whatever is on the server. At this
stage I'm not working on a way to connect an existing address book to a
server, but that could happen in future.

GL

Reply all
Reply to author
Forward
0 new messages