DocHub
4 patches required to fix broken pairing in Baileys RC9 — Platform.MACOS, passive:false, lidDbMigrated removal, noise.finishInit

Overview

Baileys 7.0.0-rc.9 (latest as of March 2026) has 4 bugs preventing pairing codes from working. WhatsApp started rejecting Platform.WEB on February 24, 2026.

Required Patches

All in node_modules/@whiskeysockets/baileys/lib/.

1. Platform.WEB → Platform.MACOS

File: Utils/validate-connection.js line 16 WhatsApp rejects Platform.WEB (value 14) since Feb 24, 2026.

2. passive: true → passive: false

File: Utils/validate-connection.js line 53 passive:true tells WhatsApp this is a passive observer — server terminates the connection.

3. Remove lidDbMigrated: false

File: Utils/validate-connection.js line 58 Non-standard field not in WhatsApp’s protocol spec — server rejects payloads containing it.

4. Remove await from noise.finishInit()

File: Socket/socket.js line 324 Awaiting creates a race condition where keep-alive fires before handshake completes.

Apply Script

BAILEYS="node_modules/@whiskeysockets/baileys/lib"
sed -i 's/Platform.WEB/Platform.MACOS/' "$BAILEYS/Utils/validate-connection.js"
sed -i 's/WebSubPlatform.MACOS_BROWSER/WebSubPlatform.WEB_BROWSER/' "$BAILEYS/Utils/validate-connection.js"
sed -i 's/passive: true,/passive: false,/' "$BAILEYS/Utils/validate-connection.js"
sed -i '/lidDbMigrated: false/d' "$BAILEYS/Utils/validate-connection.js"
sed -i '/TODO: investigate.*hard set as false/d' "$BAILEYS/Utils/validate-connection.js"
sed -i 's/await noise\.finishInit();/noise.finishInit();/' "$BAILEYS/Socket/socket.js"

Persistence

Patches are lost on npm install. Use patch-package or postinstall script.

Sources

Baileys GitHub Issues: #2364, #2365, #2370, #2376, #2306, #2381, #2393