SenCodeMaker / whatsapp-database-merger

SQL scripts to merge two or more whatsapp database easily
GNU General Public License v3.0
5 stars 2 forks source link

Failure to insert values due to unique constraints will show no errors #4

Open MrBarbie opened 1 year ago

MrBarbie commented 1 year ago

This might be a rare situation but would be very likely with backups separate by a large time gap.

The table I have noticed this is the jid table as the string needs to be unique so the modified entries will not be added if it clashes with another older id.

Sender will be messed up if jid tables are not identical because they wont refer to the right sender. Also sender jids and chat ids are not adjusted for message tables at all. So chats will appear in the wrong chats if those are not identical or have new ones added through this script.

Only way to address this is to probably do a comparison and adjust based on the results. I have no clue how this can be done.

SenCodeMaker commented 1 year ago

yes I see your problem. frankly speaking I add the same and the ID were so much messed up I decided to leave them as this. it would require a lot of work to match them up. one way would be to begin from the user number, then identify the user_id and device_id and jid associated then update the corresponding lines in each table concerned.

Le ven. 14 oct. 2022 à 10:55, MrBarbie @.***> a écrit :

This might be a rare situation but would be very likely with backups separate by a large time gap.

The table I have noticed this is the jid table as the string needs to be unique so the modified entries will not be added if it clashes with another older id.

Sender will be messed up if jid tables are not identical because they wont refer to the right sender. Also sender jids and chat ids are not adjusted for message tables at all. So chats will appear in the wrong chats if those are not identical or have new ones added through this script.

Only way to address this is to probably do a comparison and adjust based on the results. I have no clue how this can be done.

— Reply to this email directly, view it on GitHub https://github.com/SenCodeMaker/whatsapp-database-merger/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKJU2L354IUEOFI7F75RHCDWDENWNANCNFSM6AAAAAARFA5FAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MrBarbie commented 1 year ago

Can that even be done via simple batch SQL queries?

But yes lots of things to account for that are not currently being done. Also Im leaving this here just as a fyi note so people know it happens/ if someone comes along and wants to fix it.

The issue described in #2 is likely due to this. If the chat and jid ids being wrong means there is no entry the messages will just vanish