Skip to content

[Bug]: WhatsApp bridge silently drops all messages — syncFullHistory:false disables essential history sync in Baileys 7.x #11951

Description

@MassiveMassimo

Summary

The WhatsApp bridge (scripts/whatsapp-bridge/bridge.js) sets syncFullHistory: false without providing a shouldSyncHistoryMessage callback. In Baileys 7.0.0-rc.9 (the pinned version), this causes Baileys to disable all history sync — not just the full download — which prevents LID mapping and group participation data from being populated. The result: no messages arrive despite the bridge reporting a successful connection.

Current Behavior

  1. User pairs via hermes whatsapp → QR scanned → ✅ WhatsApp connected!
  2. Bridge reports connected on /health endpoint
  3. Log shows: Timeout in AwaitingInitialSync, forcing state to Online and flushing buffer
  4. No messages are ever deliveredGET /messages returns [] indefinitely
  5. Both self-chat and group messages are affected

Root Cause

In lib/Socket/index.js of @whiskeysockets/baileys@7.0.0-rc.9:

// When shouldSyncHistoryMessage is not explicitly provided by the caller,
// Baileys overrides the default callback with this:
if (config.shouldSyncHistoryMessage === undefined) {
    newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory;
}

Since Hermes sets syncFullHistory: false and does not provide shouldSyncHistoryMessage, Baileys replaces the default with () => false — rejecting all sync types including INITIAL_BOOTSTRAP, RECENT, ON_DEMAND, etc.

This triggers Baileys' own warning:

⚠️ DANGER: DISABLING ALL SYNC BY shouldSyncHistoryMsg PREVENTS BAILEYS FROM ACCESSING INITIAL LID MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS

Without these sync types, WhatsApp servers never send group participation data or LID mappings to the linked device, so incoming messages cannot be routed.

Evidence This Is a Widespread Ecosystem Bug

This exact issue has been reported across multiple Baileys-based projects:

Project Issue Status
OpenClaw #14069 — identical bug, same mechanism Closed (stale bot, never fixed)
OpenClaw #39608 — re-report 7 weeks later, still unfixed Open
Baileys #2144 — request to make AwaitingInitialSync timeout configurable Closed (stale)
Baileys #2218 — history sync not firing, workaround documented Open

Baileys Upstream Status

The bug has been fixed in Baileys source (commit c81c074, Jan 22 2026) — the maintainer deleted the buggy override. However:

  • No new npm version has been released. Latest npm package is still 7.0.0-rc.9 (Nov 21 2025).
  • Hermes pins Baileys to WhiskeySockets/Baileys#01047debd81beb20da7b7779b08edcb06aa03770, but npm install resolves GitHub refs to the npm package, so the bug persists.

Until a new Baileys release ships, all downstream projects must work around this themselves.

Suggested Fix

Add an explicit shouldSyncHistoryMessage callback to bridge.js that allows essential sync types (LID mappings, group participation) while still declining the full history download:

const sock = makeWASocket({
    // ...
    syncFullHistory: false,
    shouldSyncHistoryMessage: ({ syncType }) => {
        // proto.HistorySync.HistorySyncType.FULL = 2
        // Allow all sync types EXCEPT FULL — INITIAL_BOOTSTRAP, RECENT,
        // ON_DEMAND etc. are needed for LID mapping and group participation.
        // Without this callback, Baileys 7.x defaults to () => !!syncFullHistory
        // which disables ALL sync when syncFullHistory is false.
        return syncType !== 2;
    },
    // ...
});

This matches Baileys' own default behavior (skip FULL only) and is the same fix confirmed working across OpenClaw and direct Baileys users.

Alternative Approaches

  1. Update the Baileys pin to a commit after c81c074 — would eliminate the need for this workaround entirely, but requires ensuring npm installs from source rather than the rc.9 package.
  2. Add a config option (e.g. extra.should_sync_history) so users can control this without code changes.

Environment

  • Hermes: latest main (post hermes update April 18 2026)
  • Baileys: 7.0.0-rc.9 (pinned to WhiskeySockets/Baileys#01047debd81beb20da7b7779b08edcb06aa03770)
  • Node: v22.x
  • OS: Ubuntu 24.04 (Oracle Cloud VPS)
  • WhatsApp mode: self-chat

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundplatform/whatsappWhatsApp Business adaptertype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions