Skip to content

Conversation

@mahmouds12
Copy link
Contributor

@mahmouds12 mahmouds12 commented Dec 11, 2025

patron:PLUS

Copilot AI review requested due to automatic review settings December 11, 2025 20:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements message deduplication to prevent duplicate webhooks in the GOWS (Go-WhatsApp) engine, addressing issue #1564. The solution handles cases where WhatsApp delivers the same message multiple times, either with identical IDs or with different chat identifiers (LID vs JID) but the same underlying unique message ID.

Key Changes:

  • Added DistinctMessages() operator that deduplicates messages based on WhatsApp's unique message ID combined with the fromMe flag
  • Applied deduplication to both incoming message streams (messagesFromMe$ and messagesFromOthers$) in the GOWS session

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/core/utils/reactive.ts Adds the DistinctMessages() RxJS operator and helper function extractUniqueMessageId() to extract the unique WhatsApp-generated message ID from serialized message IDs for deduplication purposes
src/core/engines/gows/session.gows.core.ts Imports and applies DistinctMessages() to both message streams, with filter(Boolean) added before deduplication to handle null messages from processIncomingMessage()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OrionZap
Copy link

OrionZap commented Dec 13, 2025

+1

patron:PLUS

@devlikepro devlikepro merged commit 62d1b3d into devlikeapro:core Dec 17, 2025
6 checks passed
@devlikepro
Copy link
Contributor

devlikepro commented Dec 17, 2025

2025.12.2 - GOWS - fix message duplications - #1718 #1564

patron:PRO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants