Giter Site home page Giter Site logo

Comments (6)

rfc2822 avatar rfc2822 commented on May 23, 2024 2

@ArnyminerZ Can you please have a look (reproduce with a test first)? I think EventBuilder.buildEvent should handle dates with time zone, too (in the when (date) { … }) to support this specific case. Since we can't store time zone info in the contacts provider, we have to convert it into UTC.

from vcard4android.

ArnyminerZ avatar ArnyminerZ commented on May 23, 2024 1

Reproduced with a copy-paste of testType_Birthday:

@Test
fun testType_BirthdayWithTimezone() {
    EventBuilder(Uri.EMPTY, null, Contact().apply {
        birthDay = Birthday("19510311T000000+0100")
    }, false).build().also { result ->
        assertEquals(CommonDataKinds.Event.TYPE_BIRTHDAY, result[0].values[CommonDataKinds.Event.TYPE])
    }
}

from vcard4android.

devvv4ever avatar devvv4ever commented on May 23, 2024

Does unfortunately not seem to be fixed in 4.3.9 yet :-/

This is the vcard:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.4.2//EN
UID:LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0
N:Doe;John;;;
FN:John Doe
BDAY:20010415T000000+0200
ITEM1.ADR:;; ;;;;Nederland
ITEM1.X-ABLABEL:Home
CATEGORIES:_personen
GENDER:M
END:VCARD

From the logs:

2023-10-31 21:53:03 46 [network.HttpClient] <?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/addressbooks/users/frara/contacts/LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0.vcf</d:href><d:propstat><d:prop><d:getcontenttype>text/vcard; charset=utf-8</d:getcontenttype><d:getetag>&quot;6d9b6a752c6858863a9018759b9dd5ae&quot;</d:getetag><card:address-data>BEGIN:VCARD&#13;
VERSION:4.0&#13;
PRODID:-//Sabre//Sabre VObject 4.5.3//EN&#13;
UID:LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0&#13;
N:Doe;John;;;&#13;
FN:John Doe&#13;
BDAY:20010415T000000+0200&#13;
ITEM1.ADR:;; ;;;;Nederland&#13;
ITEM1.X-ABLABEL:Home&#13;
CATEGORIES:_personen&#13;
GENDER:M&#13;
END:VCARD&#13;
</card:address-data></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>

2023-10-31 21:53:03 46 [network.HttpClient] <-- END HTTP (905-byte body)
2023-10-31 21:53:03 46 [syncadapter.ContactsSyncManager] Processing CardDAV resource LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0.vcf
2023-10-31 21:53:03 46 [syncadapter.ContactsSyncManager] Creating local contact
	PARAMETER #0 = at.bitfire.vcard4android.Contact@4ce9893[addresses=[LabeledProperty(property=ezvcard.property.Address [ group=ITEM1 | parameters={} | poBoxes=[] | extendedAddresses=[] | streetAddresses=[ ] | localities=[] | regions=[] | postalCodes=[] | countries=[Nederland] ], label=Home)],anniversary=<null>,birthDay=ezvcard.property.Birthday [ group=null | parameters={} | text=null | date=2001-04-15T00:00+02:00 | partialDate=null ],categories=[_personen],customDates=[],displayName=John Doe,emails=[],familyName=Doe,givenName=John,group=false,impps=[],jobDescription=<null>,jobTitle=<null>,members=[],middleName=<null>,nickName=<null>,note=<null>,organization=<null>,phoneNumbers=[],phoneticFamilyName=<null>,phoneticGivenName=<null>,phoneticMiddleName=<null>,prefix=<null>,relations=[],suffix=<null>,uid=LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0,unknownProperties=BEGIN:VCARD
VERSION:4.0
GENDER:M
END:VCARD
,urls=[]]
2023-10-31 21:53:03 46 [contactrow.EventBuilder] Ignoring date/time without supported (partial) date
	PARAMETER #0 = ezvcard.property.Birthday [ group=null | parameters={} | text=null | date=2001-04-15T00:00+02:00 | partialDate=null ]
2023-10-31 21:53:03 46 [BatchOperation] Committing 5 operations:
2023-10-31 21:53:03 46 [BatchOperation] #0: ContentProviderOperation(type=insert uri=content://com.android.contacts/raw_contacts?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={dirty=0, sync1=LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0, sync2=6d9b6a752c6858863a9018759b9dd5ae, sync4=1, account_name=Contactpersonen ([email protected] 6A), account_type=at.bitfire.davdroid.address_book, deleted=0, sourceid=LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0.vcf})
2023-10-31 21:53:03 46 [BatchOperation] #1: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=vnd.android.cursor.item/name, raw_contact_id=android.content.ContentProviderOperation$BackReference@325f0d0, data1=John Doe, data2=John, data3=Doe, data4=null, data5=null, data6=null, data7=null, data8=null, data9=null})
2023-10-31 21:53:03 46 [BatchOperation] #2: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=vnd.android.cursor.item/postal-address_v2, data10=Nederland, raw_contact_id=android.content.ContentProviderOperation$BackReference@76718c9, data1=Nederland, data2=0, data3=Home, data4= , data5=, data6=, data7=, data8=, data9=})
2023-10-31 21:53:03 46 [BatchOperation] #3: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=vnd.android.cursor.item/group_membership, raw_contact_id=android.content.ContentProviderOperation$BackReference@4e8fbce, data1=44})
2023-10-31 21:53:03 46 [BatchOperation] #4: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=x.davdroid/unknown-properties, raw_contact_id=android.content.ContentProviderOperation$BackReference@3402aef, data1=BEGIN:VCARD
VERSION:4.0
GENDER:M
END:VCARD
})
2023-10-31 21:53:03 46 [BatchOperation] Running 5 operations (0 .. 4)
2023-10-31 21:53:03 46 [BatchOperation] … 5 record(s) affected

I also noticed that there is a "&# 13;" at the end of each line of the processed vcard. Does this has something to do with it?

Please can you check again whats the case with this vcard? @ArnyminerZ

Reference: Zammad #2891

from vcard4android.

rfc2822 avatar rfc2822 commented on May 23, 2024

Guess that's becauseVCardDateFormat.parse creates an OffsetDateTime, not a ZonedDateTime:

https://github.com/mangstadt/ez-vcard/blob/d4c9ab9fb11f4ed6d83c32bdaa2089a73043bd9b/src/main/java/ezvcard/util/VCardDateFormat.java#L185

We should

  • support OffsetDateTime in addition to (or if vCard doesn't support zoned date-times: instead of) ZonedDateTime,
  • have a test for it,
  • have a test that contains such a BDAY directly as raw string and sees whether it's converted correctly (to an OffsetDateTime) so that we can be sure that the whole conversion works in the future.

from vcard4android.

fwiep avatar fwiep commented on May 23, 2024

Hello again,

I had to wait for F-Droid to build and distribute the 4.3.10-ose package. Now I have tested and the problem is not yet fixed - but I think I know why.

If I compare the used library versions in the app's About dialog, I see the same vcard4android version as with 4.3.9-ose (b376d2e), and not version a7a1f42 which contains the most recent fix.

Is this an issue with F-Droid's build process, or is there another way to get a true-full-up-to-date apk for testing?

Thanks and kind regards,
FWieP

from vcard4android.

sunkup avatar sunkup commented on May 23, 2024

@fwiep See #26 (comment)

from vcard4android.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.