Skip to content

WhatsApp: Backfill missed messages after reconnection #50093

@maestrokling

Description

@maestrokling

Feature Request

Problem

When the WhatsApp Web connection drops (e.g. 503 errors) and reconnects, messages sent to monitored groups during the outage window are never delivered or logged. The gateway reconnects successfully but the missed messages are silently lost.

This is particularly impactful for group chats where periodic summarization is being done via the log workaround (searching /tmp/openclaw/openclaw-YYYY-MM-DD.log for "2": "inbound message" entries with a known group JID).

Expected Behavior

After reconnection, the gateway should request missed messages from WhatsApp Web for any active monitored chats, at minimum for the gap period since last successful connection.

Current Behavior

Connection drops silently lose all group messages sent during the outage. The reconnected session starts fresh with no backfill.

Context

  • WhatsApp Web protocol does support message history on session reconnect in some scenarios
  • The messagesHandled: 0 counter in the web-heartbeat logs confirms messages aren't being received during/after the outage
  • 503 errors appear as: WhatsApp Web connection closed (status 503). Retry 1/12
  • Even a short backfill window (e.g. last 2 hours on reconnect) would address the majority of cases

Workaround

Currently none — missed group messages are unrecoverable through the log workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions