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

Import verification #58

Closed maverick74 closed 1 year ago

maverick74 commented 1 year ago

I don't know if this is worth the work, but here's the idea:

On the IMPORT operation, the default behaviour should always be to wipe all SMS/MMS/Contacts and then proceed to the new data import (this would solve the duplicates problem)

However BEFORE wiping, the app should verify/compare the data from the backup with that on the phone and warn the user if there will be any data loss (if yes, it should offer export).

tmo1 commented 1 year ago

It's an interesting idea, but as you imply, it would require work, and it's also tricky to do correctly: identifying duplicates is not that simple a task, since identical contacts may have differences in the metadata Android stores about them, and we would have to figure out exactly which of the many database fields Android uses should be considered when determining identity.

SMS Import / Export's sibling project, sms-db, actually does do duplication avoidance via a hashing mechanism of the message data and metadata it stores, but I'm not sure this mechanism is ready for inclusion in SMS Import / Export.

I'll keep this issue open for further discussion.

maverick74 commented 1 year ago

Ideally a "merge/combine differences" (without duplications) would be the best option. It's probably the option users would really want, as it would avoid data loss...

But i guess combining both DB without duplicating entries would add even more to the complexity...

Thanks for considering it :)

maverick74 commented 1 year ago

@tmo1 considering you are implementing deduplication in #91 i think we can close this one...

What do you think?

Also - out of curiosity - is that the same method you used in sms-db?

tmo1 commented 1 year ago

@tmo1 considering you are implementing deduplication in #91 i think we can close this one...

What do you think?

I'll close this issue - you can always reopen it, or open a new one, if you have any further suggestions or problems.

Also - out of curiosity - is that the same method you used in sms-db?

It's similar - in sms-db, we control the database, so IIRC, we store a hash of some of the field values and upon insert, we hash the new message's field values and just compare the hashes. It's unfortunately been a while since I looked at the code, though. I did start a complete rewrite of sms-db in Python, with substantial improvement based upon what I've learned in the course of developing SMS I/E, and I'd like to continue / finish it when I get a chance.