Skip to content

[Bug]: Connection Failure (Object.decodeFrame) Loop during Pairing Code / Auth #2364

@foxyscat

Description

@foxyscat

Is this a feature request?
No

Description
I am facing a persistent Connection Failure loop related to Object.decodeFrame in noise-handler.js.
I am trying to connect using usePairingCode: true. The socket connects, sometimes generates the code, but immediately crashes with a decryption error before or right after I can enter the code on the phone.

I have tried:

Deleting the auth_info folder (fresh session).

Updating to the latest version (npm install github:WhiskeySockets/Baileys).

Changing browser config to Ubuntu/Chrome.

Using a clean simple script.

The issue persists, and the bot enters a reconnect loop with the same error.

Error Log

Error: Connection Failure
at WebSocketClient. (.../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:785:13)
at WebSocketClient.emit (node:events:508:28)
at .../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:464:35
at Object.decodeFrame (.../node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.js:141:17)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async WebSocketClient.onMessageReceived (.../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:441:9)
Environment

const { makeWASocket, useMultiFileAuthState, Browsers } = require('@whiskeysockets/baileys');

async function start() {
const { state, saveCreds } = await useMultiFileAuthState('auth_info');
const sock = makeWASocket({
auth: state,
printQRInTerminal: false,
browser: Browsers.ubuntu("Chrome"),
logger: require('pino')({ level: 'silent' })
});

if (!sock.authState.creds.registered) {
    // Crashes around here or shortly after
    const code = await sock.requestPairingCode("905xxxxxxxxx");
    console.log(code);
}

}
start();

Baileys Version: Latest (GitHub master)
OS: Windows 10/11
Connection Type: Pairing Code and QR Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions