Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

[BUG] - fetchLatestBaileysVersion() breaks the WA connection

Open FabioTessaro19 opened this issue 1 month ago • 11 comments

Describe the bug

const { version, isLatest } = await fetchLatestBaileysVersion(); // <- Here is the problem!

In the code above, when the function is called, the code never returns, causing the WhatsApp connection to become unavailable. If you set a breakpoint before calling the function and another one after it to inspect the returned values, the breakpoint after the function is never hit.

I tested commenting out this line and setting the version in makeWASocket to a fixed value, and everything went back to working normally.

To Reproduce Steps to reproduce the behavior: 1 - Try to scan the QR Code to connect WhatsApp. 1.1 - If the status is "OPENING", change it manually on database to "DISCONNECTED" and reload the page. 2 - Turn on the debugger and place breakpoints before and after the fetchLatestBaileysVersion() function. 3 - Check that the breakpoint after the function is never hit. 4 - Try commenting out the function call and set a fixed value for the version parameter in makeWASocket, for example → version: [2, 3000, 1029030078]. 5 - Watch it work.

Environment (please complete the following information): I’m using Baileys version 6.7.18.

FabioTessaro19 avatar Oct 28 '25 22:10 FabioTessaro19

this is the current version, and it stopped working like 2h ago too. we may need to migrate to 7.x.x version:[2 ,3000, 1023223821], isLatest:false

step 4 version seems to work just fine

diasEduardo avatar Oct 29 '25 01:10 diasEduardo

this is the current version, and it stopped working like 2h ago too. we may need to migrate to 7.x.x version:[2 ,3000, 1023223821], isLatest:false

step 4 version seems to work just fine

what version??? my just stoped work too..

Alexandre-Papandrea avatar Oct 29 '25 02:10 Alexandre-Papandrea

The fetchLatestBaileysVersion() function gets the Baileys version from GitHub: https://raw.githubusercontent.com/WhiskeySockets/Baileys/master/src/Defaults/index.ts

But this URL returns a 429 error.

Time to think of another way to do this.

jeffersonfelixdev avatar Oct 29 '25 05:10 jeffersonfelixdev

I tested the same snippet on Baileys v7.0.0-rc.6, and it worked fine — fetchLatestBaileysVersion() returned normally and the connection initialized without freezing.

Here’s the snippet I used for reference:

const { state, saveCreds } = SQLiteAuth();
const { version: baileysVersion } = await fetchLatestBaileysVersion();
logger.info(`[baileys] v${baileysVersion.join(".")} on ${process.platform.toUpperCase()}`);

const connectionOptions = {
    version: baileysVersion,
    logger: pino({
        level: "error",
        base: { module: "BAILEYS" },
        transport: {
            target: "pino-pretty",
            options: {
                colorize: true,
                translateTime: "HH:MM",
                ignore: "pid,hostname",
            },
        },
    }),
    browser: Browsers.ubuntu("Safari"),
    auth: {
        creds: state.creds,
        keys: SQLiteKeyStore(),
    },
};

No hanging or timeout occurred in my tests.

Image

naruyaizumi avatar Oct 29 '25 08:10 naruyaizumi

are u guys from south america?

https://github.com/orgs/community/discussions/177971

things arent working very well for us right now and github doesn't care one bit about it... ;/

gilney-canaltelecom avatar Oct 29 '25 10:10 gilney-canaltelecom

I am also using v6.7.18 and I fixed version [2, 3000, 1027934701]. It worked Image

tungboom avatar Oct 29 '25 10:10 tungboom

I found this line of code in the Baileys directory under “src/Defaults/index.ts”:

const version = [2, 3000, 1027934701];

It sets a fixed version, which was changed about two weeks ago.

My question now is: since I’m not using Baileys version 7.x.x, but rather version 6.7.18, could it be that my fetchLatestBaileysVersion function is retrieving an older version and therefore causing the connection error?

Sorry for my ignorance — I’m just trying to better understand how things work 😂

If it is the reason, so may i have to migrate to 7.x.x...

FabioTessaro19 avatar Oct 29 '25 11:10 FabioTessaro19

I found this line of code in the Baileys directory under “src/Defaults/index.ts”:

const version = [2, 3000, 1027934701];

It sets a fixed version, which was changed about two weeks ago.

My question now is: since I’m not using Baileys version 7.x.x, but rather version 6.7.18, could it be that my fetchLatestBaileysVersion function is retrieving an older version and therefore causing the connection error?

Sorry for my ignorance — I’m just trying to better understand how things work 😂

If it is the reason, so may i have to migrate to 7.x.x...

I think the only real way to avoid this issue is by migrating, since it’s hardcoded in the codebase as you mentioned. I’m running into the same problem here — do you know any site where I can check the latest stable Baileys versions? I’ve tried wa versions, but it only lists the alpha releases.

AldoWa avatar Nov 06 '25 14:11 AldoWa

I think the only real way to avoid this issue is by migrating, since it’s hardcoded in the codebase as you mentioned. I’m running into the same problem here — do you know any site where I can check the latest stable Baileys versions? I’ve tried wa versions, but it only lists the alpha releases.

I dont know any site to check the latest stable Baileys version... It would be nice if it had that! To work around the error and be able to use it without migrating, I manually set the version I got from “wa versions” myself. It’s not the recommended approach, though — alternatively, you can check the code and grab the version that was set in the latest Baileys update. Theoretically, if they defined that version, it’s because it’s compatible with the Baileys version.

FabioTessaro19 avatar Nov 06 '25 14:11 FabioTessaro19

Thanks @FabioTessaro19 👍

AldoWa avatar Nov 06 '25 15:11 AldoWa

If you constantly experience connection and disconnection , use @whiskeysockets/baileys version 6.7.21.

Block67 avatar Nov 14 '25 06:11 Block67