Closed crimsoncor closed 10 months ago
Oops, so sorry. It seems like I recently commented out a crucial line (while working on #164), should be fixed now. Hopefully that's the only problem. I don't see anything in the beta version that gives problems, but there is some username stuff that I'm not sure about.
Please try again. Thanks!
okay, so that did make it better. There does seem to be an issue with it correct discarding duplicate messages (or maybe duplicate reactions?) when doing a merge. In my case, my large backup contained some, but not all the message from the small backup. So when I did the merge I got a bunch of errors like this
[Error]: After sqlite3_step(): UNIQUE constraint failed: message.date_sent, message.from_recipient_id, message.thread_id
-> Query: "INSERT INTO message (_id,date_sent,date_received,date_server,thread_id,from_recipient_id,from_device_id,to_recipient_id,type,body,read,ct_l,exp,m_type,m_size,st,tr_id,subscription_id,receipt_timestamp,has_delivery_receipt,has_read_receipt,viewed,mismatched_identities,network_failures,expires_in,expire_started,notified,quote_id,quote_author,quote_body,quote_missing,quote_mentions,quote_type,shared_contacts,unidentified,link_previews,view_once,reactions_unread,reactions_last_seen,remote_deleted,mentions_self,notified_timestamp,server_guid,message_ranges,story_type,parent_story_id,export_state,exported,scheduled_date,latest_revision_id,original_message_id,revision_number) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
before finally failing with
Checking foreign key constraints...
ERROR Foreign key constraint violated. This will not end well, aborting.
Please report this error to the program author.
-----------------------------
| table | parent | fkid |
-----------------------------
| reaction | message | 1 |
-----------------------------
[Error]: A fatal error occurred while trying to import thread 2. Aborting
I was able to get around that by cropping the small backup to only the most recent messages that were not part of the large backup and then everything merged correctly and was happy. So no immediate problems for me, but there does seem to be some sort of newish issue when dealing with duplicate messages and/or reactions
Ok, this is all expected when merging backups with overlapping content. The tool does no automatic discarding of duplicates (that is non-trivial operation), you need to crop first (as you rightly did in the end). I think I'll update the readme to make that more clear.
The error you got at the end originally is because there is a reaction that references a message that does not exist (because its insert had failed previously with one of the earlier errors).
So, I consider this all working as expected. I'll close this, but do let me know if there is anything else. Thanks for reporting back!
oh good to know. I swear I've merged backups with dupes before but maybe I just got lucky and didn't trigger this edge case.
Got two backup files I'm trying to merge. Both are v213 files. I am in the Signal beta program so I'm running 6.42.2 of the app (this may be my issue).
Got latest from git and built this morning
When I try to merge the small file into the big, I get
When I try to merge the bigger file into the small I get