Some contacts are being duplicated on the phone, not the server



  • I'm a new user of Android and literally the first app I bought was DavDroid, as having sync between Fastmail and my phone is paramount. So far everything is working perfectly except for one issue. I am not sure if this is a DavDroid issue or an Android / Contacts app issue.

    What is happening is that some contacts are being duplicated on the phone. The duplicate contact only ever contains a phone number, not any other information like email addresses. These contacts are not synced back to the Fastmail server. After deleting the duplicate contact, it seems to return after a few days. I cannot ascertain a pattern behind which contacts are being duplicated; it seems random. It is nothing to do with calling the contact, as many duplicates are people I haven't actually phoned in years.

    Key information to note is that I don't use gmail or Google contacts. Whilst I am signed in to two Google accounts, I have explicitly set Android to not sync or use contacts. I doubled-checked that the duplicate contacts are not appearing on either of the Google accounts on their server; they are not.

    As far as I can tell, the contacts are only saved on the phone somewhere, not on any servers. I have gone through every account in Settings > Users & Accounts and checked that only one of them is set to sync contacts, Davdroid.

    I have searched the internet, stack exchange, and these forums for this problem, but I haven't been able to find other people with the same problem.

    Other relevant information:

    • The phone is a Xiaomi mi A1, running AndroidOne 8.0.0
    • Davdois is version 1.10.1.1-gplay

    I would be really, really grateful for help here. I love having a neat and organised addressbook, and duplicates spoil the fun completely.


  • developer

    Hello,

    Are you sure those duplicated contacts are created by DAVdroid? When you view them in the Contacts app, are they linked to DAVdroid or to a messenger app? Messenger apps are known to create duplicates of the contacts, and sometimes they're not merged by Android as expected.



  • Are you sure those duplicated contacts are created by DAVdroid?

    Nope, I'm not sure! I'm trying to track down the cause.

    When you view them in the Contacts app, are they linked to DAVdroid or to a messenger app?

    How do I find this information? I can't seem to find any information about which account the contact is linked to.


  • developer

    @oldmankit said in Some contacts are being duplicated on the phone, not the server:

    How do I find this information? I can't seem to find any information about which account the contact is linked to.

    On some devices (e.g. Samsung), there's a "Linked with" entry. On my Fairphone OS (which is quite plain Android 6), you have to edit the contact, then choose "More fields", and then there's another edit dialog which shows the account ("DAVdroid Addressbook Account") on the top.



  • On Xiaomi Redmi Note 3 Pro, when you edit the contact, it has the section "imported from".
    It runs MIUI 9.5.1.0 - I don't know how it relates to your version. But as it is same manufacturer, it might be similar.

    It happened to my wife's phone recently (after MIUI upgrade and/or backup again nuked all Davdroid contacts), and few contacts (with pictures) are duplicated 4 times - "imported from" there lists "google contact", "DAVdroid Address book contact", "Viber contact" and "Whatsapp contact".

    There is also the option to "Merge contact", "Separate" or "Delete 4 contact" below that section.
    So far I've been too busy fixing other issues, so haven't tried any of those yet.
    Let us know how it goes if you do!

    Interestingly, sometimes the number of "imported from" accounts and amount of dupes don't match (like 3 dupes but 4 accounts listed; or 4 dupes and 3 accounts listed)

    Note: duplication happened despite the fact that in "Settings" / "System apps" / "Contacts" / "Configure contact lists" it has ONLY "DAVdroid address book" selected.

    But I would guess it is more likely that the problem lies with MIUI (but I'm probably prejudiced to its bloat and other design issues). Or maybe it's MIUI's interaction with DAVdroid? MIUI in my experience (fixing wife's phone once every few weeks) historically was NOT being very happy with DAVDroid and owncloud apps on that phone, even after clicking all the checkboxes not to kill it, not to powersave it, yes allow it to autostart etc... Waiting for warranty to run out, so I can reformat it with LineageOS instead.



  • I've tried now, and "delete X contacts" is wrong answer, it will delete ALL copies of that contact (even if it says "delete 3 contacts" and you have 4 duplicates - all 4 will be deleted).

    Also "merge contact" will not help, as it will ask you for some other contact to merge with selected one.

    The correct option (at least on Xiaomi Redmi Note 3 Pro MIUI 9.5.1.0) seems to be "Separate" -- that will leave only 1 instance of contact in your list (and list it as "imported from DAVDroid" afterwards). So duplicate contacts seems to be some kind of Xiaomi "feature", and clicking "Separate" is the fix for it.

    (Also note that if you edit the name or any other info of any of the duplicates, they will all get updated.)



  • The Mi A1 uses Android One, which is as close to stock Android as you can get as far as I know. It's not MIUI. (Thanks @mnalis for the detailed notes all the same.)

    On my Fairphone OS (which is quite plain Android 6), you have to edit the contact, then choose "More fields", and then there's another edit dialog which shows the account ("DAVdroid Addressbook Account") on the top.

    Great tip! On the non-duplicate contacts there is a blue circle with a pencil in the lower-right of the contacts app, to edit the contact. When I tap that I see it says "DAVdroid Address book". All as you would expect.

    However on the non-duplicate contacts there is no blue circle icon to edit the contact! When I tap the three dots (for more options) I can delete, but there is no edit. So I cannot see what has created these contacts. I guess it's almost certainly not DavDroid.

    Can anyone help me track down what is creating these seemingly random duplicate contacts which I cannot delete?


  • admin

    You can maybe try to look directly into the Android contacts storage database and analyze it...



  • @devvv4ever said in Some contacts are being duplicated on the phone, not the server:

    You can maybe try to look directly into the Android contacts storage database and analyze it...

    Thank you for the suggestion. I just had a look and it appears that I cannot access this database unless the device is rooted.

    I'd really love to solve this issue but don't want to root my device. Does anyone have any other suggestions?


  • developer

    Did you try the adb method as described on https://www.davdroid.com/faq/how-to-debug/?



  • @rfc2822 said in Some contacts are being duplicated on the phone, not the server:

    Did you try the adb method as described on https://www.davdroid.com/faq/how-to-debug/?

    Awesome! Thanks so much for that tip. I was able to dump the contacts database to my computer, and low and behold the culprit is Whatsapp.

    This hasn't solved my issue, but at least I know what the problem really is now. I'm really grateful to you guys for helping me get this far.

    The story continues on StackExchange, where I just asked this question.


 

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