Duplicate contacts



  • Davdroid is creating duplicate contacts in my addressbook for certain contacts when synchronising from the server.

    It looks like the only thing these contacts have in common is that they do not have any fields set beyond a name (fields are respectively: VERSION, PRODID, UID, FN, X-CALYPSO-NAME, X-MOZILLA-HTML). Contacts with anything else at all set (email, phone) seem to be fine.

    The duplicate contacts appear to be created every time I manually sync.

    I can reproduce this even after wiping my existing accounts and addressbook, with davdroid 0.6.1



  • I've reproduced it with other contacts (with e.g. email and phone set) too.


  • developer



  • Yep, they have UIDs. I'll see if I can collect some logs today.

    On 5 August 2014 06:53:11 BST, rfc2822 notifications@github.com wrote:

    Do these contacts have an UID?


    Reply to this email directly or view it on GitHub:
    https://github.com/rfc2822/davdroid/issues/294#issuecomment-51152648

    Jelmer Vernooij jelmer@jelmer.co.uk - https://jelmer.co.uk/



  • I wonder if this is related, from the logs:

    D/davdroid.LocalCollection( 1621): Committing 5 operations
    E/ContentValues( 1544): Cannot cast value for starred to a Integer: false
    E/ContentValues( 1544): java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Number
    E/ContentValues( 1544): at android.content.ContentValues.getAsInteger(ContentValues.java:288)
    E/ContentValues( 1544): at com.android.providers.contacts.ContactsProvider2.flagExists(ContactsProvider2.java:1996)
    E/ContentValues( 1544): at com.android.providers.contacts.ContactsProvider2.updateRawContact(ContactsProvider2.java:4383)
    E/ContentValues( 1544): at com.android.providers.contacts.ContactsProvider2.updateRawContacts(ContactsProvider2.java:4297)
    E/ContentValues( 1544): at com.android.providers.contacts.ContactsProvider2.updateInTransaction(ContactsProvider2.java:3950)
    E/ContentValues( 1544): at com.android.providers.contacts.AbstractContactsProvider.update(AbstractContactsProvider.java:166)
    E/ContentValues( 1544): at com.android.providers.contacts.ContactsProvider2.update(ContactsProvider2.java:2113)
    E/ContentValues( 1544): at android.content.ContentProviderOperation.apply(ContentProviderOperation.java:225)
    E/ContentValues( 1544): at com.android.providers.contacts.AbstractContactsProvider.applyBatch(AbstractContactsProvider.java:237)
    E/ContentValues( 1544): at com.android.providers.contacts.ContactsProvider2.applyBatch(ContactsProvider2.java:2225)
    E/ContentValues( 1544): at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:260)
    E/ContentValues( 1544): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:192)
    E/ContentValues( 1544): at android.os.Binder.execTransact(Binder.java:404)
    E/ContentValues( 1544): at dalvik.system.NativeStart.run(Native Method)
    I/davdroid.SyncManager( 1621): Updating C610A978-5BB0-0001-3ECE-135F10BACC10.vcf

    FWIW this phone only has no Google accounts on it and just one Davdroid account.



  • It seems like android is assuming the RawContacts.STARRED flag to be a long (ContactsProvider2.java:4517), while davdroid is creating it as a boolean (src/at/bitfire/davdroid/resource/LocalAddressBook.java:612)


  • developer

    It seems like android is assuming the RawContacts.STARRED flag to be a long (ContactsProvider2.java:4517), while davdroid is creating it as a boolean (src/at/bitfire/davdroid/resource/LocalAddressBook.java:612)

    Thanks for the info, I'll have a look at this.


  • developer

    The STARRED flag is now set as an int which hopefully fixes this problem. If this issue is still present in the next version of DAVdroid, please feel free to post again / reopen the issue.



  • I built davdroid from source and gave this a try.

    While the fix in 88972ae has helped - the exceptions in the logs related to the favorites are now gone - it doesn't appear to have fixed the duplicates. :-(



  • Please reopen this issue (I don't seem to have the permissions to do so).


  • developer

    Ok, so can you please read Reporting issues and provide all information mentioned there, including detailled steps to reproduce and verbose logs?


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.