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

set birthday year to 1970 if no year, take X-APPLE-OMIT-YEAR into account #11832

Merged
merged 3 commits into from
Feb 20, 2019

Conversation

georgehrke
Copy link
Member

fixes #9849

@georgehrke georgehrke added the 2. developing Work in progress label Oct 14, 2018
@georgehrke georgehrke added this to the Nextcloud 15 milestone Oct 14, 2018
@tessus
Copy link

tessus commented Oct 14, 2018

@georgehrke ok, so what happens, if someone is born in 1970?

also, a date w/o a year is specified as --MMDD, see https://tools.ietf.org/html/rfc6350#section-6.2.5

@georgehrke
Copy link
Member Author

@tessus someone born in 1970 will simply by shown as „Name (*1970)“

Parsing of --MMDD should be taken care of by DateTimeParser::parseVCardDateTime, not by the code in question.

Please note that all the dates you can see in the code are iCalendar dates, not vCard dates.

@tessus
Copy link

tessus commented Oct 14, 2018

Ah, I see. Thanks a lot for the explanation.

@georgehrke georgehrke force-pushed the bugfix/9849/birthday_without_year branch from 163c40c to b3ae314 Compare October 15, 2018 06:04
@tobiasKaminsky
Copy link
Member

@georgehrke can I test this? Then I'll give it a try with the Samsung S9 tomorrow.

@georgehrke georgehrke force-pushed the bugfix/9849/birthday_without_year branch from b3ae314 to ecce3f3 Compare October 15, 2018 06:16
@georgehrke
Copy link
Member Author

@tobiasKaminsky Yes please :)
But I have yet to add a migration step that cleans up old events.

@tobiasKaminsky
Copy link
Member

I tested adding a new contact on Samsung S9+, once with stable14 and once with this PR: set birthday to 14.10. without a year.

Both time, I see "1604-10-14" as date in contacts app: 👍
In calendar I do see both contacts as "Name *", occurring every year: 👍

But on calendar of Samsung S9, I do not see any birthday entry.
Also on businness calendar 2 I do not see it.

This is what I get when exporting the contacts in question via contacts app on NC14.

BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVdroid/1.10.1.1-ose ez-vcard/0.10.3
UID:c50ad44e-b48e-460f-abdc-9143df54a505
FN:Test Geburtstag 
N:Geburtstag;Test;;;
BDAY:--1014
REV:20181017T202813Z
END:VCARD

BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVdroid/1.10.1.1-ose ez-vcard/0.10.3
UID:09bcda7d-e60d-47a4-b877-60c76d972744
FN:Test 2
N:2;Test;;;
BDAY:--1015
REV:20181017T203412Z
END:VCARD

@MorrisJobke MorrisJobke mentioned this pull request Nov 6, 2018
29 tasks
@MorrisJobke
Copy link
Member

@georgehrke What about this? Is this ready by tomorrow evening?

@georgehrke
Copy link
Member Author

georgehrke commented Nov 6, 2018

No, i think i need a hands-on with an android device for this. Really running out of ideas.
But this is a bug fix only anyway, so we can just backport it.

@tobiasKaminsky
Copy link
Member

Unfortunately I cannot bring the device to hackweek :/
Maybe I can get the contacts apk from device.

@MorrisJobke MorrisJobke mentioned this pull request Nov 8, 2018
24 tasks
@MorrisJobke
Copy link
Member

I guess this is nothing that is ready for backport by tomorrow, right?

@MorrisJobke MorrisJobke mentioned this pull request Nov 22, 2018
7 tasks
@georgehrke georgehrke force-pushed the bugfix/9849/birthday_without_year branch from ecce3f3 to 3c0ba15 Compare November 27, 2018 14:33
@tobiasKaminsky
Copy link
Member

👍 works for Samsung :-)

@georgehrke
Copy link
Member Author

georgehrke commented Nov 27, 2018

* -> 🎂
† -> ⚰️
⚭ -> 💍🏳️‍🌈

@georgehrke
Copy link
Member Author

@nickvergessen Do we create mysql database with 4 byte support by default now?

@MorrisJobke
Copy link
Member

@nickvergessen Do we create mysql database with 4 byte support by default now?

Yes.

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 29, 2018
@MorrisJobke
Copy link
Member

@georgehrke Ready to review, right?

@MorrisJobke MorrisJobke added the 2. developing Work in progress label Nov 29, 2018
@MorrisJobke MorrisJobke added this to the Nextcloud 15.0.4 milestone Jan 30, 2019
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
@georgehrke georgehrke force-pushed the bugfix/9849/birthday_without_year branch from 3c0ba15 to 3acde07 Compare February 16, 2019 15:30
@georgehrke georgehrke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 16, 2019
@georgehrke
Copy link
Member Author

added the migration step. Please test

@tobiasKaminsky
Copy link
Member

Hm. For some reason this is not working anymore:

  • created a contact with Samsung S9+
  • added birthday to it without year, e.g. 10.02.
  • synced to server
  • see it on web ui in contacts and in calendar
  • do not see it on calendar on Samsung S9+ (its own calendar app) :-/
  • see it on Business Calendar 2

I am now unsure if this was working with the first version of this PR.

This is what I see as calendar entry:

Displaying `/nc/remote.php/dav/calendars/livi/contact_birthdays/contacts-399ad5f2-ea67-44b7-b9d0-618a88c4594d.vcf.ics':
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20190218T080919Z
DTSTART;VALUE=DATE:19000211
DTEND;VALUE=DATE:19000212
UID:399ad5f2-ea67-44b7-b9d0-618a88c4594d
RRULE:FREQ=YEARLY
SUMMARY:Test 2 *
TRANSP:TRANSPARENT
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-PT0M
ACTION:DISPLAY
DESCRIPTION:Test 2 *
END:VALARM
END:VEVENT
END:VCALENDAR

Shouldn't there be something like 1970? Apple omit year?

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Feb 19, 2019

So this is what I get when I create a contact "Georg" with birthday set to 18. February:

dav:/nc/remote.php/dav/addressbooks/users/livi/contacts/> cat 890673d4-4601-47c0-9b21-829d69981986.vcf 
Displaying `/nc/remote.php/dav/addressbooks/users/livi/contacts/890673d4-4601-47c0-9b21-829d69981986.vcf':
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
UID:890673d4-4601-47c0-9b21-829d69981986
FN:Georg
N:;Georg;;;
BDAY;X-APPLE-OMIT-YEAR=1604:1604-02-18
REV:20190219T222329Z
END:VCARD

This is the calendar entry:

Displaying `/nc/remote.php/dav/calendars/livi/contact_birthdays/contacts-890673d4-4601-47c0-9b21-829d69981986.vcf.ics':
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20190219T222329Z
DTSTART;VALUE=DATE:19000218
DTEND;VALUE=DATE:19000219
UID:890673d4-4601-47c0-9b21-829d69981986
RRULE:FREQ=YEARLY
SUMMARY:Georg *
TRANSP:TRANSPARENT
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-PT0M
ACTION:DISPLAY
DESCRIPTION:Georg *
END:VALARM
END:VEVENT
END:VCALENDAR

And this is not shown in Business Calendar 2 nor in Samsung's Calendar.
However it is shown in both apps when they parse addressbook and create their own birthday calendar (but this is independent from this issue).

For reference this is a contact T1 with birthday set to 18.02.2018:

Displaying `/nc/remote.php/dav/addressbooks/users/livi/contacts/39c4cfba-41ca-4096-b6f5-b6801eb46dbc.vcf':
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
UID:39c4cfba-41ca-4096-b6f5-b6801eb46dbc
FN:T1
N:;T1;;;
BDAY:20180218
REV:20190219T224557Z
END:VCARD

And this is the corresponding calendar entry:

Displaying `/nc/remote.php/dav/calendars/livi/contact_birthdays/contacts-39c4cfba-41ca-4096-b6f5-b6801eb46dbc.vcf.ics':
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20190219T224558Z
DTSTART;VALUE=DATE:20180218
DTEND;VALUE=DATE:20180219
UID:39c4cfba-41ca-4096-b6f5-b6801eb46dbc
RRULE:FREQ=YEARLY
SUMMARY:T1 (*2018)
TRANSP:TRANSPARENT
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-PT0M
ACTION:DISPLAY
DESCRIPTION:T1 (*2018)
END:VALARM
END:VEVENT
END:VCALENDAR

This is shown in "contacts birthday" calendar synced via DavX5, both in Samsung's calendar app and Business Calendar 2.

@tobiasKaminsky
Copy link
Member

The big question is now why does DavX5 (or whatever) not sync/parse the birthday event in such a way that it is shown in Business Calendar 2 / Samsung's Calendar.

On DavX5 I set to sync all calendar events and not only latest 90 days, but still no success.

@tobiasKaminsky
Copy link
Member

Yehaaa.
I tested it with a fresh installation and clean DB, now it works.
Dunno know what was wrong last night…

@tobiasKaminsky
Copy link
Member

Can we backport this also to 15? ❤️

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@MorrisJobke MorrisJobke merged commit 2b76e27 into master Feb 20, 2019
@MorrisJobke MorrisJobke deleted the bugfix/9849/birthday_without_year branch February 20, 2019 09:16
@MorrisJobke
Copy link
Member

/backport to stable15

@backportbot-nextcloud
Copy link

The backport to stable15 failed. Please do this backport manually.

@MorrisJobke
Copy link
Member

Let's then not do the backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Birthday without birthyear
5 participants