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

my.fbmessenger.android: exclude unsent messages to avoid duplication #393

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions my/fbmessenger/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ def _process_db_msys(db: sqlite3.Connection) -> Iterator[Res[Entity]]:
CAST(sender_id AS TEXT) AS sender_id,
reply_source_id
FROM messages
WHERE
/* Regular message_id conforms to mid.* regex.
However seems that when message is not sent yet it doesn't have this server id yet
(happened only once, but could be just luck of course!)
We exclude these messages to avoid duplication.
However poisitive filter (e.g. message_id LIKE 'mid%') feels a bit wrong, e.g. what if mesage ids change or something
So instead this excludes only such unsent messages.
*/
message_id != offline_threading_id
ORDER BY timestamp_ms /* they aren't in order in the database, so need to sort */
'''
):
Expand Down
Loading