Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CardDAV does not sync/accept a birthday field without a year #4287

Closed
tessus opened this issue Apr 10, 2017 · 26 comments
Closed

CardDAV does not sync/accept a birthday field without a year #4287

tessus opened this issue Apr 10, 2017 · 26 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: dav needs info

Comments

@tessus
Copy link

tessus commented Apr 10, 2017

Opening a separate issue as requested in nextcloud/contacts#161

Steps to reproduce

  1. Create a contact on your device without a year. Sync.
  2. Create a contact on the MacOSX Contacts app. Sync.

Expected behaviour

  1. The date should be synced without a year.
  2. The date should be synced without a year.

Actual behaviour

  1. The birthday is missing from the VCARD on the server. Never shows up in the nextcloud contacts app.
BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVdroid/1.4.0.3-ose vcard4android ez-vcard/0.10.
 1
UID:88e64a5b-c154-4d21-82f1-3800f9ff063b
FN:Birthday Without-Year
N:Without-Year;Birthday;;;
EMAIL;TYPE=home:no@birthday.com
REV:20170312T223956Z
END:VCARD
  1. The year 1604 is shown in the nextcloud contacts app.
BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN
N:Without-Year-OSX;Birthday;;;
FN:Birthday Without-Year-OSX
EMAIL;type=INTERNET;type=HOME;type=pref:no@birthday.com
BDAY;X-APPLE-OMIT-YEAR=1604:1604-06-20
REV:2017-03-12T22:42:30Z
UID:00eefa1d-32d2-4a61-bd6f-e127c2e69024
END:VCARD

In all cases the VCARD should contain the correct BDAY format for a birthday without a year. In the specifications for vcard 3.0 and 4.0, there are options to do so.

Server configuration

Operating system: Linux

Web server: Apache 2.4.25

Database: MySQL 5.6.25

PHP version: 5.6.30

Nextcloud version: 11.0.2

Contacts version: 1.5.3

Updated from an older Nextcloud or fresh install: updated: oc 8.2.9 -> nc 9.0.57 -> 10.0.4 -> 11.0.2

Signing status:

No errors have been found.

List of activated apps:

Enabled:
  - activity: 2.4.1
  - activitylog: 0.0.1
  - admin_audit: 1.1.0
  - announcementcenter: 3.0.0
  - apporder: 0.3.3
  - bookmarks: 0.9.1
  - calendar: 1.5.1
  - comments: 1.1.0
  - contacts: 1.5.3
  - dav: 1.1.1
  - direct_menu: 0.10.0
  - external: 1.2
  - federatedfilesharing: 1.1.1
  - federation: 1.1.1
  - files: 1.6.1
  - files_external: 1.1.2
  - files_markdown: 1.0.1
  - files_pdfviewer: 1.0.1
  - files_sharing: 1.1.1
  - files_texteditor: 2.2
  - files_trashbin: 1.1.0
  - files_versions: 1.4.0
  - files_videoplayer: 1.0.0
  - firstrunwizard: 2.0
  - gallery: 16.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.0
  - notifications: 1.0.1
  - password_policy: 1.1.0
  - provisioning_api: 1.1.0
  - serverinfo: 1.1.1
  - sharebymail: 1.0.1
  - systemtags: 1.1.3
  - tasks: 0.9.5
  - templateeditor: 0.2
  - theming: 1.1.1
  - twofactor_backupcodes: 1.0.0
  - updatenotification: 1.1.1
  - user_external: 0.4
  - workflowengine: 1.1.1
Disabled:
  - encryption
  - files_accesscontrol
  - files_automatedtagging
  - files_retention
  - survey_client
  - user_ldap
  - user_saml

The content of config/config.php:

{
    "system": {
        "instanceid": "oc2352d53521",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "\/data\/nextcloud\/data",
        "dbtype": "mysql",
        "version": "11.0.2.7",
        "installed": true,
        "forcessl": true,
        "loglevel": 2,
        "maintenance": false,
        "trusted_domains": [
            "cloud.evermeet.cx"
        ],
        "share_folder": "\/Shared",
        "dbname": "nextcloud",
        "dbhost": "localhost",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logdateformat": "Y-m-d H:i:s O",
        "logtimezone": "Europe\/Vienna",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "php",
        "mail_from_address": "evercloud",
        "mail_domain": "evermeet.cx",
        "mail_smtpsecure": "tls",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "\/data\/redis\/redis.sock",
            "port": 0,
            "timeout": 0
        },
        "appstore.experimental.enabled": true,
        "trashbin_retention_obligation": "auto",
        "updater.release.channel": "stable",
        "htaccess.RewriteBase": "\/",
        "overwrite.cli.url": "https:\/\/cloud.evermeet.cx",
        "auth.bruteforce.protection.enabled": false
    }
}

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox 52, Chrome 57.0.2987.98

Operating system: Mac OSX 10.11.6

CardDAV-clients: DAVdroid 1.4.0.3-ose, OSX Contacts Sync (from the OS)

Logs

Web server error log

no errors (empty)

Nextcloud log (data/nextcloud.log)

no errors (empty)

Browser log

no errors (empty)
@MorrisJobke
Copy link
Member

Duplicate of #3084

@tessus
Copy link
Author

tessus commented Apr 11, 2017

@MorrisJobke this is not a duplicate. as you can see in my first test case, the birthday is actually lost. data loss. Only the second one is the duplicate.

@tessus
Copy link
Author

tessus commented Apr 11, 2017

maybe you didn't see it, because the 'Actual result' section had two items with the number 2. that was a typo and I have corrected it.

@MorrisJobke
Copy link
Member

@MorrisJobke this is not a duplicate. as you can see in my first test case, the birthday is actually lost. data loss. Only the second one is the duplicate.

Ah - it's completely gone? Sorry haven't seen this :/

@MorrisJobke MorrisJobke reopened this Apr 11, 2017
@MorrisJobke
Copy link
Member

cc @georgehrke

@tessus
Copy link
Author

tessus commented Apr 11, 2017

Ah - it's completely gone? Sorry haven't seen this :/

Unfortunately yes. That's why I lost all my birthdays which had no years.

Device synced to server. Server dropped the entire birthday. Next sync all my birthdays wihout a year were gone from my device.

@nickvergessen
Copy link
Member

That's unfortunate. I guess the problem is, that VCard 3.0 has no real support for "without a year". So apple introduced their own hack (1604). I guess it's fine if that is shown in the contacts app.

But I guess I can also see the sabre dav plugin deleting the malformed BDAY. So not sure how we could best solve this.

@rullzer
Copy link
Member

rullzer commented Apr 11, 2017

@nickvergessen as far as I can tell there is official support for no year... --MMDD should do it... It is on my list to see where it fails hard...

@nickvergessen
Copy link
Member

That was added with Version 4.0:

             BDAY:19960415
             BDAY:--0415
             BDAY;19531015T231000Z
             BDAY;VALUE=text:circa 1800

Version 3.0 only has:

        BDAY:1996-04-15
        BDAY:1953-10-15T23:10:00Z
        BDAY:1987-09-27T08:30:00-06:00

@rullzer
Copy link
Member

rullzer commented Apr 11, 2017

aaah I had the wrong RFC on my phone last night..
well if V3 doesn't support it there is not much we can do at the moment I think 😞

@tessus
Copy link
Author

tessus commented Apr 11, 2017

hmm, somehow I had the following for v3 in my head --MM-DD, but maybe this is an ISO spec and not CardDAV.
In any case, what about 4.0? I thought that both formats were supported. If not, wouldn't it be a good idea to switch to 4.0, if 3.0 has such a great lack of functionality. As far as I know, the bday field is not the only shortcoming of 3.0.

@tessus
Copy link
Author

tessus commented Apr 12, 2017

As another side note, or an idea actually: maybe if Nextcloud supports both formats, there could be an option to migrate the existing 3.0 data to 4.0 data. Wouldn't that be a great solution to solve a lot of issues?

@nickvergessen
Copy link
Member

The problem is, not all clients interacting with our endpoints might understand V4.0
That is exactly why such things like versions exit, right?

@tessus
Copy link
Author

tessus commented Apr 12, 2017

This I do understand, what I don't understand is why the server drops the field, instead of using v4.0.

I mean, if my Vcard on my device has the birthday as --MM-DD, and it shows it on my device, why is it gone after syncing it to nextcloud?
I'm using DavDroid (the latest and greatest version) which understands 4.0, so something is wrong.

Also, if I knew that all my devices understood 4.0, why should I not be able to convert all the 3.0 cards to 4.0? In that case, the server has not even a chance to try to use this useless 3.0 format.

@tessus
Copy link
Author

tessus commented Apr 13, 2017

I do understand that you want to accommodate as many people as possible.

However, there's a caveat as well. These days almost 90% of all people have the capability to use CardDav 4.0 which includes their devices and/or sync SW. To make 10% of all people happy, 90% have to suffer the flaws of a broken and lacking 3.0 spec.

Make it up to the admin who runs the nc instance. Let them decide. Forcing everyone to use 3.0 for "the sake of interchangeability" is a flawed solution.

Apple even removed all USB ports from their new MBs, which I found truly IDIOTIC, but hey, Apple still makes tons of money.

@tessus
Copy link
Author

tessus commented Apr 13, 2017

To clarify:

As you can see in my problem description, the VCard synced to nc is version 4.0. Yet the BDAY was dropped.

But this is only part of the problem. What happens, if a 3.0 card is synced to the client and I add a BDAY without a year to that entry. Is the card converted to 4.0 on the client and sent as 4.0 or will the client just add the field and send it as 3.0 despite the fact that a BDAY wihout a year is not 3.0 compliant?

@tessus
Copy link
Author

tessus commented Oct 3, 2017

any update on this? it has been 6 months...

@tessus
Copy link
Author

tessus commented Oct 14, 2017

Ping. Any update?

@j-ed
Copy link
Contributor

j-ed commented Oct 15, 2017

If 3.0 doesn't support it yet and 4.0 is not an option, why not creating a work-around with a dummy-year of e.g. 1910 or 2049 etc.. So all dates without a year are automatically assigned to that year.

@tessus
Copy link
Author

tessus commented Oct 15, 2017

I still do not understand why 4.0 is not an option. At least let the nextcloud admin decide which standard to use. Make it a server option. Problem solved.

An honest question: which clients do not understand 4.0 these days? (I really would like to know the answer to that question.)

why not creating a work-around with a dummy-year of e.g. 1910 or 2049

Yes, Apple does this. They set the year to 1604 and uses a custom header X-APPLE-OMIT-YEAR=1604:

BDAY;X-APPLE-OMIT-YEAR=1604:1604-06-20

@jofrax
Copy link

jofrax commented Jan 30, 2018

The carddav protocol can support both vcard 3.0 and 4.0 in one server - it's then the clients choice which to use.

In rfc6352 a client can ask with supported-address-data, if a the server supports vcard 4.0 and then send a receive vcard 4.0 data. The address-data element also has a version attribute.
This should be implemented to fix this bug.

@sellth
Copy link

sellth commented Apr 3, 2018

I'd like to support this issue. Please add (additional) support for vCard 4.0. The Android contacts app supports year-less dates as does DAVdroid and the Cardbook extension for Thunderbird.

Use case: I will not ask my colleagues how old they are when adding their birthdate to my contact information.

@tessus
Copy link
Author

tessus commented Apr 4, 2018

@sellth The worst thing is that a date without a birthday is lost during a sync, so there's data loss involved. Unfortunately this doesn't seem to be deemed important enough. I had opened an issue with owncloud several years ago, but nothing ever happened.

I'm in the process of moving my contacts to a separate CardDAV server application. It's a shame that such a simple but basic thing isn't supported in nextcloud.

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@skjnldsv
Copy link
Member

skjnldsv commented Jun 6, 2019

For you @georgehrke

@stale stale bot removed the stale Ticket or PR with no recent activity label Jun 6, 2019
@skjnldsv skjnldsv added 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info stale Ticket or PR with no recent activity labels Jun 6, 2019
@stale stale bot removed stale Ticket or PR with no recent activity labels Jun 6, 2019
@georgehrke
Copy link
Member

@skjnldsv You can answer best if the Contacts app support VCARD 4.0 😉

According to @tessus comment in #9849 (comment) the data is synced just fine.

Additionally, the related issue that no birthday events were generated for such contacts was fixed with #11832

@tessus I guess we can close this?

@skjnldsv
Copy link
Member

skjnldsv commented Jun 6, 2019

Well, we do support it now (not fully, but we understand it)
So I guess we can close now. The server accept it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: dav needs info
Projects
None yet
Development

No branches or pull requests

10 participants