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

Updated tables to October2022 Schema #7

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

MrBarbie
Copy link

Updated all the present tables to the October2022 Schema.

MrBarbie and others added 15 commits October 14, 2022 03:22
Initial work in progress update for october schema, does not build currently
Updated ignoreConsistencyChecks and switched order of `chat` and `messsage` tables. Also fixed some formatting inconsistencies
Change is intended to get around behaviour of the code when mapping and offsetting referenced ids.
Intended to go with Main.kt Circular "capable" version 2.2

Because Mapping is done before processing the tables which identifies uniques, the values are offset too far because those entries duplicated unique indexes are still there and hence counted for offset. By processing `chat` first, the chance of a potentially in accurate mapping is lower as `message` should not contain entries which have the unique indexes clashing. The only scenario this will happen is if there are duplicated msgs. Whereas with `chat` it is gauranteed to contain a clash if you have continuously interacted with at least 1 contact and had new ones as well.

Effect: In the previous order chat_row_ids will be in accurate if there were lines are skipped due to unique indexes set for `chat` table, where the likelihood is much higher than `message` table.
Updated main.kt to break up the processing of table to the following order:
>process `jid`
>map `message`
>process all non `jid` tables starting with `chat`

The 3 main table have to be in listed in the specific order or `jid` > `chat` > `message` in Schema.kt
Increased the amount of offset by1 to avoid overlap due to `message` table behaviour listing 0 as jid when it is one-to-one chats and for messages from self. Where before all those jid will overlap with the last jid in the first database. As of now it doesnt affect the display of those messages as all the other infromation makes it display correctly, but would it break in the future? who knows.

This change makes it easier for the user to search for those jids that should be 0 be searching for the id that will be reported as missing in the output consistency check. They can then fix it if they like.

The user needs to change the `sort_id` for the first line in `message` table to 1 from 0, otherwise you will not get the full output consistency check as it will fail on this column.
Allow full output consistency check to be completed even with offset increased by 1.
You should expect to see 1 entry missing that will be +1 of the first table's jid entries.
Added the following tables: `message_location`, `message_mentions`, `message_quoted_location`, `message_quoted_media`, `message_quoted_mentions`, `message_quoted_text`, `message_quoted_vcard`, `message_ftsv2_docsize`, `message_ftsv2_content`, `message_view_once_media`, `community_chat`, `call_log`, `call_log_participant_v2`,
Fixed missing `,` for the additional timestamp parameter for some tables that were added in last commit
Removed selfRef that doesnt exist. Also fix some formatting with indents
Why the change to -1 instead of 0????
@MrBarbie
Copy link
Author

@natario1 This should now included all fixes discussed in #5 to have the tool working again.

There is one unresolved inconsequential problem described in 26bf3f0. The branch is intended to fix it with some manual intervention outside of the tool as I have no capability to update this tool to deal with it.
If someone wants to address it, basically we need a way to deal with situations where the id become a nonsensical 0 OR -1. Because it just adds the offset at the moment and these weird ids need a different offset it ends up refering to the wrong ids.
At the moment it doesnt seem to affect how the messages show up.

@MrBarbie
Copy link
Author

I shall leave the version revision to you

Undo readme changes from commit 64a3685
Undo Schema and IDMapping changes from commit 64a3685
Undo Schema and IDMapping changes from commit 64a3685
Undo readme changes from commit 64a3685
Undo Schema and IDMapping changes from commit 64a3685
@MrBarbie
Copy link
Author

MrBarbie commented Oct 23, 2022

Apologies for the mess of the last few commits since the last msg. Did an oopsie and had to fix it which also went a bit weird

Added info on the schema version name by WhatsApp. This info can be found by browsing the `props` table with the value `msgtore_db_schema_version` in the `key` column
All current tables have appropriate timestamps defined
Added ignoreConsistencyChecks so it doesnt fail on `-1` id reported in a user's database. My own had reference which was missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants