Describe the bug.
When creating a WhatsApp Web client with LocalAuth and reusing the same clientId, the client sometimes gets stuck on the loading screen.
This happens after restarting my application and trying to initialize an existing client session.
const { app } = require("electron");
const { v7: uuidv7 } = require("uuid");
let clientId = uuidv7();
const Store = require("electron-store");
const store = new Store();
client[clientId] = new Client({
puppeteer: {
pipe: true,
executablePath: store.get("chromePath"),
},
session: clientId,
authStrategy: new LocalAuth({
clientId: clientId,
dataPath: app.getPath("userData") + "/sessions",
}),
});
try {
client[clientId].initialize();
electronLogs.info(`Client ${clientId} is initializing`);
} catch (e) {
console.log("Error initializing client:", e);
}
client[clientId].on("loading_screen", (percent, message) => {
console.log("Loading:", percent, message);
});
more on
https://github.com/pedroslopez/whatsapp-web.js/issues/3712
CC: @sterile schooner