openclaw - 💡(How to fix) Fix [Bug] WhatsApp messages have duplicated content (repeated text) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54324Fetched 2026-04-08 01:29:00
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
1
Author
Participants
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Error Message

WhatsApp gateway shows frequent disconnect/reconnect cycles:

[2026-03-25 02:06:52] WhatsApp gateway disconnected (status 408)
[2026-03-25 02:06:58] WhatsApp gateway connected
[2026-03-25 03:54:53] WhatsApp gateway disconnected (status 503)
[2026-03-25 03:55:00] WhatsApp gateway connected
[2026-03-25 05:28:31] WhatsApp gateway disconnected (status 428)
[2026-03-25 05:28:37] WhatsApp gateway connected

Root Cause

This appears to be related to Issue #51398: "WhatsApp proactive sends broken: requireActiveWebListener uses duplicated listeners Map"

The JS bundles have duplicated listeners Map instances:

  1. web-Cz_8x_nz.js sets the listener in model-selection's Map
  2. RPC handler checks a different Map in discord-CcCLMjHw.js

This causes the message to be sent successfully but the RPC layer thinks it failed, triggering retry mechanisms.

Fix Action

Fix / Workaround

Workaround Attempted

Code Example

[2026-03-25 02:06:52] WhatsApp gateway disconnected (status 408)
[2026-03-25 02:06:58] WhatsApp gateway connected
[2026-03-25 03:54:53] WhatsApp gateway disconnected (status 503)
[2026-03-25 03:55:00] WhatsApp gateway connected
[2026-03-25 05:28:31] WhatsApp gateway disconnected (status 428)
[2026-03-25 05:28:37] WhatsApp gateway connected
RAW_BUFFERClick to expand / collapse

Bug Description

Every message sent via WhatsApp channel has its content duplicated multiple times. The message appears repeated in the chat.

Example:

  • Expected: "Hello, how are you?"
  • Actual: "Hello, how are you? Hello, how are you? Hello, how are you? Hello, how are you?"

The pattern shows content being repeated: msg1: a1,a1,a1,a1; msg2: b1,b1,b1,b1

Environment

  • OpenClaw version: 2026.3.23-2 (7ffe7e4)
  • Node version: v25.8.1
  • OS: Linux 6.17.0-generic (x64)
  • Channel: WhatsApp (whatsapp-web)
  • Gateway mode: local

Steps to Reproduce

  1. Start a conversation with OpenClaw via WhatsApp
  2. Send any message or receive any response
  3. Observe that the message content is duplicated multiple times

Expected Behavior

Each message should be sent and displayed exactly once.

Actual Behavior

Message content is repeated multiple times (appears to be 3-4 repetitions per message).

Logs

WhatsApp gateway shows frequent disconnect/reconnect cycles:

[2026-03-25 02:06:52] WhatsApp gateway disconnected (status 408)
[2026-03-25 02:06:58] WhatsApp gateway connected
[2026-03-25 03:54:53] WhatsApp gateway disconnected (status 503)
[2026-03-25 03:55:00] WhatsApp gateway connected
[2026-03-25 05:28:31] WhatsApp gateway disconnected (status 428)
[2026-03-25 05:28:37] WhatsApp gateway connected

Root Cause Analysis

This appears to be related to Issue #51398: "WhatsApp proactive sends broken: requireActiveWebListener uses duplicated listeners Map"

The JS bundles have duplicated listeners Map instances:

  1. web-Cz_8x_nz.js sets the listener in model-selection's Map
  2. RPC handler checks a different Map in discord-CcCLMjHw.js

This causes the message to be sent successfully but the RPC layer thinks it failed, triggering retry mechanisms.

Related Issues

  • #51398 - WhatsApp proactive sends broken (duplicated listeners Map)
  • #54103 - Configurable Message Send Retry for Unreliable Networks

Possible Fix

  1. Short-term: Restart gateway (openclaw gateway restart) to clear state
  2. Long-term: Fix the duplicated listeners Map issue in the bundling process

Workaround Attempted

  • Increased debounceMs from 0 to 100ms
  • Restarted WhatsApp plugin and gateway
  • Issue persists after restart

/cc @gzxmren

extent analysis

Fix Plan

To address the issue of duplicated message content, we need to fix the duplicated listeners Map issue in the bundling process. Here are the steps:

  • Step 1: Identify and merge duplicated listeners
    • Locate the JS bundles (web-Cz_8x_nz.js and discord-CcCLMjHw.js) and identify the duplicated listeners Map instances.
    • Merge the duplicated Map instances into a single instance.
  • Step 2: Update the RPC handler
    • Update the RPC handler to check the single, merged listeners Map instance.
  • Step 3: Implement a retry mechanism with a cooldown period
    • Implement a retry mechanism with a cooldown period to prevent excessive retries.

Example code snippet to merge duplicated listeners:

// Merge duplicated listeners into a single Map instance
const listeners = new Map();
// ... populate the listeners Map instance ...

// Update the RPC handler to check the single listeners Map instance
function rpcHandler(message) {
  if (listeners.has(message.id)) {
    // Message has already been sent, do not retry
    return;
  }
  // Send the message and add it to the listeners Map instance
  listeners.set(message.id, true);
  // ... send the message ...
}

Example code snippet to implement a retry mechanism with a cooldown period:

// Implement a retry mechanism with a cooldown period
const retryCooldown = 5000; // 5 seconds
const maxRetries = 3;

function sendMessage(message) {
  let retries = 0;
  function retry() {
    // Send the message
    // ... send the message ...
    // If the message fails to send, retry after the cooldown period
    if (retries < maxRetries) {
      retries++;
      setTimeout(retry, retryCooldown);
    }
  }
  retry();
}

Verification

To verify that the fix worked, restart the gateway and send a message via WhatsApp. The message should be sent and displayed exactly once, without any duplicates.

Extra Tips

  • Make sure to test the fix thoroughly to ensure that it resolves the issue.
  • Consider implementing a more robust retry mechanism that takes into account the specific requirements of your application.
  • Keep an eye on the logs to ensure that the gateway is not experiencing frequent disconnect/reconnect cycles.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug] WhatsApp messages have duplicated content (repeated text) [1 comments, 2 participants]