GjjvdBurg / signal2html

Export a Signal backup to pretty HTML
MIT License
111 stars 15 forks source link

Database version 110: thread table has no recipient_ids column #34

Closed sbaum closed 3 years ago

sbaum commented 3 years ago

Hello, I've just found signal2html, as it is exactly what I was looking for. Unfortunately, it does not work (Signal version 5.17.3 running on Android 11):

Found untested Signal database version: 110.
Traceback (most recent call last):
  File "signal2html/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "signal2html/lib/python3.8/site-packages/signal2html/__main__.py", line 15, in main
    sys.exit(realmain())
  File "signal2html/lib/python3.8/site-packages/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "signal2html/lib/python3.8/site-packages/signal2html/core.py", line 590, in process_backup
    query = db.execute("SELECT _id, recipient_ids FROM thread")
sqlite3.OperationalError: no such column: recipient_ids

The thread table looks like that:

sqlite> PRAGMA table_info(thread);
0|_id|INTEGER|0||1
1|date|INTEGER|0|0|0
2|thread_recipient_id|INTEGER|0||0
3|message_count|INTEGER|0|0|0
4|snippet|TEXT|0||0
5|snippet_charset|INTEGER|0|0|0
6|snippet_type|INTEGER|0|0|0
7|snippet_uri|TEXT|0|NULL|0
8|snippet_content_type|INTEGER|0|NULL|0
9|snippet_extras|TEXT|0|NULL|0
10|read|INTEGER|0|1|0
11|type|INTEGER|0|0|0
12|error|INTEGER|0|0|0
13|archived|INTEGER|0|0|0
14|status|INTEGER|0|0|0
15|expires_in|INTEGER|0|0|0
16|last_seen|INTEGER|0|0|0
17|has_sent|INTEGER|0|0|0
18|delivery_receipt_count|INTEGER|0|0|0
19|read_receipt_count|INTEGER|0|0|0
20|unread_count|INTEGER|0|0|0
21|last_scrolled|INTEGER|0|0|0
22|pinned|INTEGER|0|0|0
GjjvdBurg commented 3 years ago

Hi @sbaum, thanks for raising this issue. I've added a bugfix in #35, but as my Signal database version isn't yet on version 110 I can't test if it works. If you could do so and let me know if it solves the issue that would be great.

sbaum commented 3 years ago

Hi @GjjvdBurg, wow, that was quick, and the error message is gone! :slightly_smiling_face: But as I don't know, how signal2html was working with older database versions (because I didn't use it earlier), I'm not sure if this is expected:

Is that expected behaviour?

GjjvdBurg commented 3 years ago

Thanks for the quick followup @sbaum! Too bad it didn't fix it fully. In that case there seems to be more going on than just the rewrite of the column name and I'll have to take a more careful look.

In case you'd like to explore it yourself, essentially what has happened is that Signal has updated the database schema (starting here and later changes), and we need to match these with what we were querying before. Each of the issues you describe is not expected behavior and need to be addressed.

GjjvdBurg commented 3 years ago

Hi @sbaum, can you check with the version in the updated PR? I think it'll work now

sbaum commented 3 years ago

Thank you @GjjvdBurg! I just did a quick test and the problems seem to be solved. :slightly_smiling_face:

GjjvdBurg commented 3 years ago

Thanks for confirming @sbaum!