Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

fix: store inbound group messages from history sync (fall back to WebMessageInfo participant) (#763)

Nasir Naqash6dcc18bc6e82
diff --git a/src/infrastructure/whatsapp/history_sync.go b/src/infrastructure/whatsapp/history_sync.go
index 2baa7e62..0237d6d6 100644
--- a/src/infrastructure/whatsapp/history_sync.go
+++ b/src/infrastructure/whatsapp/history_sync.go
@@ -164,6 +164,14 @@ func processConversationMessages(ctx context.Context, data *waHistorySync.Histor
}
} else {
participant := msgKey.GetParticipant()
+ if participant == "" {
+ // History-sync group messages carry the sender in the
+ // WebMessageInfo-level `participant` (usually a @lid), NOT in
+ // key.participant (which is empty for synced group messages).
+ // Without this fallback, every inbound group message in a
+ // history sync is dropped below as "no participant info".
+ participant = msg.GetParticipant()
+ }
if participant != "" {
// For group messages, participant contains the actual sender
if parsedSenderJID, err := types.ParseJID(participant); err == nil {