Issue Description
Using specific account, the message keeps pending forever for any new chat not sent a message before:
Reproduction Steps
I am not able to re produce it on another account, just on a new number account i have it.
Code Sample
async sendMessage(
client: Client,
phone: string,
message: string,
messageId: string,
uid?: string
): Promise<void> {
const chatId = phone.includes('@') ? phone : `${phone}@c.us`;
try {
this.logger.log(`Sending message to ${phone}`);
// Ensure chat exists before sending
try {
await this.withTimeout(
client.getChatById(chatId),
10_000,
`Chat lookup timed out for ${phone}`
);
} catch {
this.logger.debug(`No chat found for ${phone} — creating one`);
try {
await this.withTimeout(
(client as any).createChat(chatId),
15_000,
`Chat creation timed out for ${phone}`
);
// Give WhatsApp some time to fully initialize the chat
await new Promise(resolve => setTimeout(resolve, 1500));
} catch (createErr) {
this.logger.warn(
`Could not create chat for ${phone}: ${createErr.message}`
);
}
}
const result = await this.withTimeout(
client.sendMessage(chatId, message),
this.TIMEOUT_SEND,
`Message send timed out to ${phone}`
);
this.logger.debug(`Message sent: ${result.id._serialized}`);
} catch (error) {
await this.handleMessageError(
error,
phone,
messageId,
undefined,
message,
uid
);
throw error;
}
}
User Setup
| WhatsApp |
Type |
| Account Type |
WhatsApp Business |
| Authentication Strategy |
LocalAuth |
| WhatsApp Web Version |
latest |
| whatsapp-web.js Version |
latest |
| Environment |
Version |
| Browser Type |
Chromium |
| Browser Version |
144.0.7559.96 |
| Phone OS Version |
Android 11 |
| Running OS Version |
Ubuntu 24 |
| Node.js Version |
22.14.0 |
Checklist
Issue Description
Using specific account, the message keeps pending forever for any new chat not sent a message before:
Reproduction Steps
I am not able to re produce it on another account, just on a new number account i have it.
Code Sample
User Setup
Checklist