monica icon indicating copy to clipboard operation
monica copied to clipboard

Monica creating duplicate contacts

Open akn101 opened this issue 3 years ago • 46 comments

Upon creating a new contact through the web client, two contacts are added into the database. image One version appears to be the normal version, and another is a vcard version.

I'm running a self-hosted version of Monica v3.7.0

akn101 avatar Jun 01 '22 23:06 akn101

I'm testing Monica for the first time and have noticed duplicates as well. In my case, I have a Monica CardDAV account configured on my iPhone and the native Contacts app is filling up with duplicates whenever I edit a contact.

suderman avatar Jun 08 '22 15:06 suderman

+1 : same for me on iOS

tomyvi avatar Jul 12 '22 13:07 tomyvi

I am using the monicahq.com hosted version 3.7.0 and this is happening consistently. I hope this gets noticed as a high priority issue as it makes the service entirely unusable.

Trying to create a new contact from my iPhone using Monica as the default and primary contacts source, the contact is saved in Monica but then duplicated consistently, I believe as other have stated it happens on edit.

  • On iPhone: I now have 7 duplicates of the same contact. The original is still present but duplicates get created with the phone type changed from mobile to "CELL.
  • On the Monica website the original exits as well as two duplicates.

kmuncie avatar Jul 17 '22 14:07 kmuncie

Noticed this a while ago, and set davx5 on my phone to treat it as read only, thinking this would one day be fixed. I'm surprised it hasn't been for years.

Ryonez avatar Jul 17 '22 17:07 Ryonez

Hi, just started playing around with the software and love the idea but also just noticed this bug. Have 4/5 of the same contacts on my android now (Davx5).

Davercade avatar Jul 27 '22 11:07 Davercade

Having the same problem. I get a duplicate contact every time I edit a contact on the web app.

aarnold89 avatar Aug 29 '22 17:08 aarnold89

Same problem for me on IOS.

whmountains avatar Sep 29 '22 16:09 whmountains

Same problem, every edit I do in the phone creates a new contact on monica (sync with Davx5)

raschle avatar Sep 30 '22 06:09 raschle

Same here. Android/Davx5

FranPregernik avatar Nov 03 '22 19:11 FranPregernik

Same problem, using DAVx5 on Android

phorcys420 avatar Nov 17 '22 19:11 phorcys420

+1. Same issue, using DAVx5 on Android as well.

Looking at the timeline, I'm wondering if this just started, or has it been an on-going issue for years?

expionage avatar Nov 28 '22 20:11 expionage

Any update on this?

mwolfaardt avatar Nov 30 '22 19:11 mwolfaardt

I have the same problem, first in the self-installed version and also in the cloud version. Unfortunately, this is a really annoying bug that has been open for far too long. Unfortunately, I don't see anyone who has provided a pull request to fix it.

For $90 a year, I expect more support.

schneider-de-com avatar Dec 10 '22 21:12 schneider-de-com

I think Monica team is busy building: https://www.officelife.io/

------- Original Message ------- On Saturday, December 10th, 2022 at 6:54 PM, Sven Schneider @.***> wrote:

I have the same problem, first in the self-installed version and also in the cloud version. Unfortunately, this is a really annoying bug that has been open for far too long. Unfortunately, I don't see anyone who has provided a pull request to fix it.

For $90 a year, I expect more support.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

whmountains avatar Dec 11 '22 05:12 whmountains

That's a pity. Given this issue could lead to data lose, I would've imagined it to be of priority.

Ryonez avatar Dec 11 '22 05:12 Ryonez

I'll give it a go, no promises though.

Never worked with carddav so I don't know what is considered the unique identify. I'm sure I'll find in somewhere...

On Sun, 11 Dec 2022, 06:58 Ryonia Coruscare, @.***> wrote:

That's a pity. Given this issue could lead to data lose, I would've imagined it to be of priority.

— Reply to this email directly, view it on GitHub https://github.com/monicahq/monica/issues/6175#issuecomment-1345466381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGFVUW2SL5HRWNBH26QKC3WMVUQNANCNFSM5XTDNO5A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

FranPregernik avatar Dec 11 '22 10:12 FranPregernik

You can find the rfc under https://www.rfc-editor.org/rfc/rfc6352

schneider-de-com avatar Dec 11 '22 10:12 schneider-de-com

Small update...

Test case: Add simple contact via web UI (first name, last name, gender only). Sync via carddav. Edit contact and add email (important! will explain later) and save. Two contacts are created.

The \App\Http\Controllers\DAV\Backend\CardDAV\CardDAVBackend::updateCard calls the \App\Services\VCard\ImportVCard service which fetches the existing contact and should update it if the contact exists (it does exist) and then it calls the questionable method \App\Services\VCard\ImportVCard::importGeneralInformation which has an IF at the end.

It seems to me that the IF is there to decide whether to insert a new contact or update the existing one BUT it has an optimization for the update branch to prevent unnecessary updates as far as I can tell. https://github.com/monicahq/monica/blob/a07317f309f25772925436346b4ebb23b6e69b43/app/Services/VCard/ImportVCard.php#L579-L583

The test above will produces equal $contactData (new) and $original (old) because the email is not part of the structure. So the IF will create a new contact (via the CreateContact service) which will get updated (email) in the parent method \App\Services\VCard\ImportVCard::importEntry https://github.com/monicahq/monica/blob/a07317f309f25772925436346b4ebb23b6e69b43/app/Services/VCard/ImportVCard.php#L538-L545

IMHO the IF should just check the $contact and that is what I will be testing.

But I would like @asbiin to comment.

FranPregernik avatar Dec 29 '22 07:12 FranPregernik

Please fix this as this is preventing me from actually using monica

JustYannicc avatar Mar 18 '23 18:03 JustYannicc

I've forked Monica and edited ImportVCard.php on my self-hosted version as mentioned by @FranPregernik here: https://github.com/monicahq/monica/issues/6175#issuecomment-1367131522 and it's working beautifully for me. No more duplicate contacts - it actually feels usable now

Edit: I spoke too soon. It's started duplicating again. I'll look again shortly as this is super irritating :)

ashleyhindle avatar Mar 23 '23 11:03 ashleyhindle

I've forked Monica and edited ImportVCard.php on my self-hosted version as mentioned by @FranPregernik here: https://github.com/monicahq/monica/issues/6175#issuecomment-1367131522 and it's working beautifully for me. No more duplicate contacts - it actually feels usable now

Hey, do you think you could put a PR together for the rest of us to enjoy usable contact syncing?

Thanks.

phorcys420 avatar Mar 23 '23 13:03 phorcys420

Edit: I spoke too soon. It's started duplicating again. I'll look again shortly as this is super irritating :)

Hey, any news about this topic? :)

duracell avatar Jun 10 '23 09:06 duracell

Honestly, as much as this has some nice features, broken contact syncing has pushed me into using my Nextcloud instance for contacts now.

Ryonez avatar Jun 20 '23 04:06 Ryonez

It seems with iOS 17 beta this breaks a lot, because (that's my guess) with new synced contact pictures and posters (which happens in the background) it will create multiple new contacts, and because of this new contacts the sync seems to get triggered again and again. I had 20 contacts of one person. Without fixing it will even worse than before.

duracell avatar Jul 30 '23 16:07 duracell

hey all, it seems that the contact duplicating might be coming from DAVx5, I unsynced (uncheck and then refresh) the contacts and synced them, and all the duplicates are gone

phorcys420 avatar Aug 21 '23 20:08 phorcys420

hey all, it seems that the contact duplicating might be coming from DAVx5, I unsynced (uncheck and then refresh) the contacts and synced them, and all the duplicates are gone

Sounds like you might have had a different issue. The one being tracked has the duplicates on Monica's side. Even if you unsynced with DAVx5, you'd still get the duplicates back with the resync with the issue being tracked here.

Ryonez avatar Aug 21 '23 20:08 Ryonez

hey all, it seems that the contact duplicating might be coming from DAVx5, I unsynced (uncheck and then refresh) the contacts and synced them, and all the duplicates are gone

Sounds like you might have had a different issue. The one being tracked has the duplicates on Monica's side. Even if you unsynced with DAVx5, you'd still get the duplicates back with the resync with the issue being tracked here.

probably, I checked my db and there was only one of every contact. every time DAVx5 resyncs (on every refresh, new duplicates appear locally) I get new duplicates too, hence why it looked like the same issue.

phorcys420 avatar Aug 21 '23 20:08 phorcys420

Allgood, am glad you managed to get yours sorted though.

Ryonez avatar Aug 21 '23 20:08 Ryonez

I have the same problem on Android 13 using Davx5 running on tags/v4.0.0.

Currently a workaround is to uncheck the contacts in Davx5and sync. This will delete all contacts on the phone. Then check contact sync again and sync. This takes a while and will have all contacts back on your phone.

This method has a second duplicate left for some accounts - those with a social media account (e.g. whatsapp or telegram).

I hope we get this solved. I love Monica CRM and want to use it. The main feature for me is the sync with the phone. If this is broken or unreliable I cannot sue this.

ulfgebhardt avatar Oct 29 '23 05:10 ulfgebhardt

After some testing:

Upstream works as expected - when you change things on the phone it seems to work fine.

When changing contacts in monica crm (especially the name) and syncing them a new entry in the phones address book is created and the old one remains, creating a duplicate. Most of the time the duplicate is linked with the old entry, but not all the time.

ulfgebhardt avatar Oct 29 '23 08:10 ulfgebhardt