Skip to content

Commit

Permalink
my.fbmessenger.android: exclude unsent messages to avoid duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Sep 21, 2024
1 parent 6a18f47 commit 2ca323d
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 2ca323d

Please sign in to comment.