RainLoop / rainloop-webmail

Simple, modern & fast web-based email client
http://rainloop.net
MIT License
4.1k stars 885 forks source link

CardDav Sync Doubles and Triples Contacts #1127

Open adueck opened 8 years ago

adueck commented 8 years ago

I have connected Rainloop to my Fruux CardDAV server and all my contacts have been doubled or tripled. This seems to be an issue that has come up before, and it hasn't fully been resolved yet.

It sounds like these closed issues show exact same problem that I am having: https://github.com/RainLoop/rainloop-webmail/issues/188, https://github.com/RainLoop/rainloop-webmail/issues/192

averymd commented 3 years ago

Despite repeatedly following the workarounds in those linked issues, my contacts kept doubling and tripling. I have over 500 contacts and the connection between my two little servers typically times out on the first attempts to sync, so that might be a factor in this whole situation.

What I noticed in the DB is that the rainloop_ab_contacts.id_contact_str value was the same in the duplicated contacts. I haven't looked in the PHP code to verify this, but I'm guessing that's just the remote ID or Rainloop's version of it. I put a unique index on that column, and it seems to have resolved the duplication issue.