Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Original message not found" when quoting messages after --importfromdesktop #266

Open
kwinz opened this issue Dec 19, 2024 · 2 comments
Open
Labels
awaiting response Further information is requested

Comments

@kwinz
Copy link

kwinz commented Dec 19, 2024

I have imported my Desktop chat history into my Signal Android app. See #264. At first I thought everything was working perfectly.

But since then when I quote messages, even if they are both my Android and Desktop logs from the Desktop app, I keep getting "Original message not found" on my Android app.

The recepients seem to be getting the messages okay, and the Signal Desktop app also shows them okay.

I am not 100% sure this was caused by the -importfromdesktop. It could also be a bug in the Signal Android app. But I never noticed those errors before importing the log with signalbackup-tools.

Any idea how to resolve this?

@kwinz kwinz changed the title "Original message not found" when quoting messages after -importfromdesktop "Original message not found" when quoting messages after --importfromdesktop Dec 19, 2024
@bepaald
Copy link
Owner

bepaald commented Dec 19, 2024

That is an interesting problem. I'm not entirely sure what is happening here.

I did quickly try to reproduce it, I have a phone with a backup created by --importfromdesktop, but all quotes there seem to work fine. I will need to think about this. A few questions:

  • Does this happen only when quoting messages that were imported from the Desktop data, or does it also happen when quoting a new message?
  • Was the backup you imported the Desktop data into empty? Did it contain any contacts (that you know)? Did it contain any messages (were some messages doubled after importing the Desktop data)?

If it's not too much trouble, could export a new backup from your phone, and run the following:

./signalbackup-tools [input] [passphrase] --runsqlquery "SELECT date_sent,from_recipient_id,body,quote_id,quote_author,quote_body,quote_missing FROM message WHERE body LIKE '%[SOME_UNIQUE_STRING]%' OR quote_body LIKE '%[SOME_UNIQUE_STRING]%'" --querymode line

Where [SOME_UNIQUE_STRING] is a part of a quoted message that shows this problem? For example, when testing this function I created a group specifically for testing importing contacts from desktop:

optimized_scrsh

So I run it with the string for contact testing and I get:

 $ ./signalbackup-tools ~/PHONE/DEVsignal-2024-12-18-16-15-31.backup 000000000000000000000000000000 --runsqlquery "SELECT date_sent,from_recipient_id,body,quote_id,quote_author,quote_body,quote_missing FROM message WHERE body LIKE '%for contact testing%' OR quote_body LIKE '%for contact testing%'" --querymode line
 *** Starting log: 2024-12-19 14:31:29 ***
signalbackup-tools (./signalbackup-tools) source version 20241216.155411 (SQlite: 3.47.2, OpenSSL: OpenSSL 3.4.0 22 Oct 2024)
BACKUPFILE VERSION: 1
BACKUPFILE SIZE: 113394442
COUNTER: 4086801626
Reading backup file: 100.0%... done!
Database version: 260
 * Executing query: SELECT date_sent,from_recipient_id,body,quote_id,quote_author,quote_body,quote_missing FROM message WHERE body LIKE '%for contact testing%' OR quote_body LIKE '%for contact testing%'
 === Row 1/2 ===
        date_sent : 1728816465714
from_recipient_id : 4
             body : New group for contact testing
         quote_id : 0
     quote_author : 0
       quote_body : (NULL)
    quote_missing : 0
 === Row 2/2 ===
        date_sent : 1728816491522
from_recipient_id : 44
             body : (NULL)
         quote_id : 1728816465714
     quote_author : 4
       quote_body : New group for contact testing
    quote_missing : 0

It would be interesting to see if the date_sent and quote_id match, as well as the from_recipient_id and quote_author. Maybe I will also need to find this message in the Desktop data to see what values are in there.

Anyway, like I said, not sure what is going on right now, but hopefully we can find out.

Thanks for your report.

@bepaald
Copy link
Owner

bepaald commented Jan 6, 2025

So, after some more research, I think it must be the case that either:

  1. The timestamp of the message in the Android backup differs from the Desktop data. This is expected to happen if a message with the same timestamp already exists in that same thread (doubled messages are imported). The timestamp is then adjusted on import, as the Android database does not allow duplicate timestamps. I see no easy solution to this.
  2. The quote author has received a different _id between the original message and the message quoting it. It is possible this is a side effect from --importdesktopcontacts (not sure though). Did you use that option when importing (I don't see it mentioned in your previous issue)? Otherwise I don't know why the quote author could change.

Output from the query mentioned in my previous post will probably provide some answers.

@bepaald bepaald added the awaiting response Further information is requested label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants