mautrix / whatsapp

A Matrix-WhatsApp puppeting bridge
https://maunium.net/go/mautrix-whatsapp
GNU Affero General Public License v3.0
1.27k stars 172 forks source link

Last message in chat regularly duplicated. #303

Closed Gredin67 closed 2 years ago

Gredin67 commented 3 years ago

I get the last message of a group regularly duplicated. It looks to appear after some days not getting message in a group chat. The problem seems to stop after a new message is sent in the group. The duplication happens during some kind of backfilling process, where a vast majority of messages are ignored: [May 14, 2021 16:30:35] [Portal/83739-1979157@g.us/DEBUG] Not handling E28AFC65E7FBB5F418756B: message is duplicate But some are duplicated: [May 14, 2021 16:30:35] [Matrix/@whatsapp_339469:xxxxxxx.fr/DEBUG] PUT https://mat-n.fr/_matrix/client/r0/rooms/%21cUkpKkLSiu:sge.fr/send/m.room.message/mautrix-go_162100262_2?ts=1614530&user_id=%40whatsapp_3369%3As.fr {"msgtype":"m.text","body":"Semaine pro plutôt"}

prurigro commented 3 years ago

I've been having the same issue- just checked the actual whatsapp app and the chats that were spamming duplicates all showed as having unread messages (despite having read the chat in element). This started happening after upgrading to 0.1.7 and re-logging in (due to a week of most messages not being relayed on 0.1.6)

Edit: Scratch that, the chats getting repeated just repeated themselves again despite now being read in the whatsapp app.

prurigro commented 3 years ago

So after watching the issue for a few weeks now, it seems like certain chats get the duplication issue whenever whatsapp reconnects successfully, which seems like an issue where the re-sync is skipping all read messages except the last one for whatever reason.

EDIT: I think I may have figured it out; the archlinux AUR package updated the systemd service and prevented write access to anywhere except the default location for the database, which I wasn't using. I'll report back if the problem appears again, but I can't see this not having been the issue (for me) at this point.

erdnaxeli commented 3 years ago

I have the same problem of duplicated messages, but I do have write access to the database. I will look at the log when it happens again.

tulir commented 2 years ago

This probably can't happen anymore