sms-ie icon indicating copy to clipboard operation
sms-ie copied to clipboard

Importing Contacts Creating Duplicate Entries

Open rshxyz opened this issue 3 years ago • 6 comments

Recently went through contacts and did some name changes, I then exported contacts using the app and imported contacts on another phone. Some contacts show up as duplicate and I think it's only signal messaging app contacts

To reproduce the problem Contact must be a signal contact

  1. Have no contacts
  2. Add new contact with their signal phone number and a random name
  3. Go to signal messaging app, find the number, you can see their name is not updated, click on their profile and click on contact details
  4. Go back to the contacts app, you should now see phone number and the option of using signal (could take a bit of time but you need to wait til you see signal messaging option)
  5. export the contacts (you will only see 1 contact exported)
  6. delete the contact of the number or all if you want (obviously make sure you have a backup if you deleted all contacts)
  7. import contacts (you will see 2 contacted imported)
  8. you now have 2 contacts with the same number and name

I wasn't able to reproduce the problem of them having different names but i was able to at least reproduce the double entries so hopefully fixing that fixes the name problem

rshxyz avatar Nov 01 '22 07:11 rshxyz

Thank you for reporting this, but I was unable to reproduce the problem (on a fresh emulator image). In step 4, I'm not sure where I'm supposed to see "the option of using signal." I waited a bit, saw nothing, and proceeded. In steps 7-8, I only see one contact.

In any event, this is probably related to #52. If you can upload the exported JSON file (you can and should redact all PII - it shouldn't be too difficult with the minimal file in question), I can take a look and try to figure out and possibly fix the problem.

tmo1 avatar Nov 02 '22 20:11 tmo1

This is what i meant in step 4 you can see that now you can call or message someone from the contacts app

Screenshot

Here is me doing what I outlined above and the output it generated

contacts-redacted.txt

rshxyz avatar Nov 03 '22 17:11 rshxyz

Thanks! I tried importing the redacted file you provided: the app reported 2 contacts imported (as expected), the contacts app showed only 1 contact added, but when I tried to edit that contact, Android asked which of 2 versions of the contact I wanted to edit. Is this what you're seeing, or are you getting something else?

For more accurate analysis, it would probably help to have a version of the file closer to the actual one, where like values are redacted to like ones and unlike ones to unlike ones, e.g., all instances of "rshxyz" to "John Doe", "Thomas More" to "Adam Smith", "123-456-7890" to "555-555-1234", and "987-654-2310" to "555-555-5678", etc.

tmo1 avatar Nov 04 '22 19:11 tmo1

@tmo1 I can reproduce this issues on android 14.

Steps :

  1. Make sure some of your contacts using WhatsApp and WhatsApp is also installed on your phone.
  2. Export all the contacts.
  3. Delete all existing contacts and re-import exported file.
  4. See the results.

I have 199 contacts (which app show correct after export is finished) and whenever I import them back, it is always 450+. If a contact has multiple phone numbers saved and if more than one of those numbers uses WhatsApp, then importing will create many duplicates of same contact.

I am willing to provide any information/details you require to work on this issue.

Sinestr0 avatar Sep 01 '24 16:09 Sinestr0

Thank you for the report. I don't use WhatsApp, and I'm not sure how to approach this problem, but I'll keep it in mind. It would be helpful to have a minimal reproducible example, i.e., an export with just one or two contacts that demonstrates the problem, redacted in line with the guidelines I provided above

tmo1 avatar Sep 01 '24 19:09 tmo1

@tmo1 It took me few days to figure out how too produce redacted file. I tried to run the python script you provided and it was endlessly processing, my guess is, it is for messages and not for contacts that's why it was not giving any outputs. I wish if there's specific script just for contacts. I am neither a developer nor have much technical knowledge to modify script by myself.

Coming to the point, I exported contacts with just 2 contacts to reproduce the issue. I can see that there are "account_type" mentions with WhatsApp. From what I can understand after reading README on this project, all the raw data of contacts are exported into json file. Take my words/suggestions with a pinch of salt as I do not have much technical knowledge. Any Contact app (ie. Google's contacts app, Fossify Contact app) shows (and probably stores too) data if the specific contact is using other messenging apps or similar services like WhatsApp, Signal, WhatsApp Business. In fossify contact app, if someone tries to export contacts, it asks which contacts to export, with checkboxes for Phone Storage, WhatsApp (if installed and some of contacts using WhatsApp), Signal (if installed and some of contacts using Signal). In that case, just exporting Phone Storage (just unticking whatsapp, signal or any other checkboxes I mentioned above) might resolve the issue we are experiencing here. So my suggestion is, what if we try to just export "Phone Storage" rather than exporting all raw data (which includes WhatsApp information, Signal information and other similar information).

I will provide redacted file once you modify python script which works for contacts.

Sinestr0 avatar Sep 14 '24 06:09 Sinestr0