tmo1 / sms-ie

SMS Import / Export is a simple Android app that imports and exports SMS and MMS messages, call logs, and contacts from and to JSON / NDJSON files.
GNU General Public License v3.0
336 stars 39 forks source link

Importing Contacts Creating Duplicate Entries #68

Open rshxyz opened 1 year ago

rshxyz commented 1 year ago

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

tmo1 commented 1 year ago

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.

rshxyz commented 1 year ago

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

tmo1 commented 1 year ago

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.

Sinestr0 commented 6 days ago

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

tmo1 commented 6 days ago

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