monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.51k stars 2.15k forks source link

Monica creating duplicate contacts #6175

Open akn101 opened 2 years ago

akn101 commented 2 years ago

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

suderman commented 2 years ago

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.

tomyvi commented 2 years ago

+1 : same for me on iOS

kmuncie commented 2 years ago

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.

Ryonez commented 2 years ago

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.

Davercade commented 2 years ago

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).

aarnold89 commented 2 years ago

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

whmountains commented 2 years ago

Same problem for me on IOS.

FranPregernik commented 1 year ago

Same here. Android/Davx5

phorcys420 commented 1 year ago

Same problem, using DAVx5 on Android

expionage commented 1 year ago

+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?

mwolfaardt commented 1 year ago

Any update on this?

schneider-de-com commented 1 year ago

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.

whmountains commented 1 year ago

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: @.***>

Ryonez commented 1 year ago

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

FranPregernik commented 1 year ago

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: @.***>

schneider-de-com commented 1 year ago

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

FranPregernik commented 1 year ago

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.

JustYannicc commented 1 year ago

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

ashleyhindle commented 1 year ago

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 :)

phorcys420 commented 1 year ago

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.

duracell commented 1 year ago

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? :)

Ryonez commented 1 year ago

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

duracell commented 1 year ago

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.

phorcys420 commented 1 year ago

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

Ryonez commented 1 year ago

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.

phorcys420 commented 1 year ago

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.

Ryonez commented 1 year ago

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

ulfgebhardt commented 11 months ago

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 commented 11 months ago

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.

FinlayDaG33k commented 9 months ago

Another downside appears when using birthdays with say, Thunderbird, it'll cause your calendar to show the same birthday a bunch of times.

afbeelding afbeelding

bjornbostrom commented 9 months ago

Experiencing the same problem (with version 4.0.0). If I update contacts on my Android as well as in Thunderbird, it renders a duplicate contacts in Monica. As for now the CardDav integration is pretty much unusable.

bjornbostrom commented 7 months ago

any update on this issue?

JustYannicc commented 7 months ago

Realistically, this project is dead. There hasn't been an update in over a year. They are probably focusing on OfficeLife and have neglected this project. I do not believe this will ever be fixed at this point. I really liked monica, but because of this bug, I stopped using it. I think this bug is probably a major reason people cancel their subscriptions if they have one.

jmuchovej commented 7 months ago

@JustYannicc

Realistically, this project is dead.

The project isn't dead. They've been working on a complete rewrite. https://github.com/monicahq/monica/tree/beta

ulfgebhardt commented 7 months ago

I tried Monica and because of this bug I moved to https://github.com/sabre-io/Baikal - its a single purpose solution and does not match all things monica claims to do, but the one thing I was looking for - dav syncing - it does very well. I can recommend.

I use it in combination with https://github.com/IT4Change/InfCloud (https://inf-it.com/open-source/clients/infcloud/) - which somehow allows desktop manipulation of the dav records.

JustYannicc commented 7 months ago

The project isn't dead. They've been working on a complete rewrite.

Last commit in that branch was in October. Face it, Monica is a great idea but has clearly been abounded.

FinlayDaG33k commented 7 months ago

They are probably focusing on OfficeLife

OfficeLife hasn't had a commit in 2 years. Looking at their profiles, the Monica devs seem to be mainly working on https://github.com/monicahq/touslesprenoms.

They did merge #7099 into Monica last month so I wouldn't exactly say "abandoned" as much as "low priority".

phorcys420 commented 7 months ago

Last commit in that branch was in October. Face it, Monica is a great idea but has clearly been abounded.

The rewrite is on the main branch, not on the beta branch, Monica is not abandoned, they are simply focusing on the rewrite. While this issue is really annoying, they will rewrite the DAV sync for the new version anyway, i do think this issue should get the devs' attention, but it's not so maybe you can write some script to clone the data from Monica into a CardDAV server like Radicale or anything else as a workaround.

duracell commented 7 months ago

For me it's really annoying that the devs just ignores the error and don't comment this. If they would say "we will not fix it in the current monica release, but this will be fixed in new version" it would be good to know. Currently I think this will never be fixed and I just don't use monica anymore.

phorcys420 commented 7 months ago

They are a small team, it makes sense to prioritize other more important work.

duracell commented 7 months ago

Yeah, but to prioritize means to look at the issue and then can just comment the priority. To prioritize doesn't mean just don't comment the issue.

Ryonez commented 7 months ago

Communication is wildly important for projects.

And honestly, this is a bug enough to force users to leave.

There's no communication from the team on a bug that breaks expected use, it's been there for... about two years. I've had to shift to a working system away from Monica, and they are really not given much in the way of confidence for their new version. When it releases, after experiencing this, the interest is going to be lower and there will be more hesitation.