WhatsApp MCP: has_media flag incorrectly set for text-only messages

Resolved 💬 2 comments Opened Dec 7, 2025 by soundworker-com Closed Dec 7, 2025

Summary

The WhatsApp MCP service incorrectly sets has_media=1 for text-only messages in the whatsapp.db database.

Impact

  • 542 text messages incorrectly marked as having media
  • Only 43 text messages correctly have has_media=0
  • Causes downstream display issues in message-hub (showing [Attachment: No analysis] for plain text)

Evidence

-- Distribution of has_media vs message_type in whatsapp.db
SELECT has_media, message_type, COUNT(*) FROM messages 
GROUP BY has_media, message_type ORDER BY COUNT(*) DESC;

has_media=1, message_type=0: 542  -- text messages incorrectly flagged
has_media=0, message_type=10: 187 -- system messages
has_media=1, message_type=1: 153  -- actual images (correct)
has_media=0, message_type=0: 43   -- text messages correctly flagged

Example

Message ID 1150 in whatsapp.db:

  • text: "Perfekt, vielen Dank. Das sollte reichen☺️. Bis morgen."
  • has_media: 1 (should be 0)
  • message_type: 0

Workaround

message-hub now suppresses the [Attachment: No analysis] fallback when:

  1. Message has text content AND
  2. No actual attachment found in attachments.db

Location

The bug is likely in the WhatsApp message sync logic that populates whatsapp.db.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗