Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group Messages - "Waiting for this message. This may take a while." #2764

Open
1 task done
gxlpes opened this issue Feb 6, 2024 · 5 comments
Open
1 task done

Group Messages - "Waiting for this message. This may take a while." #2764

gxlpes opened this issue Feb 6, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@gxlpes
Copy link

gxlpes commented Feb 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

"After sending messages to groups, this bug starts randomly. Sending messages to individual numbers is working fine, but sending to groups is not working properly.

I always receive the WhatsApp message 'Waiting for this message. This may take a while." after one or two successful messages to groups.

image

Expected behavior

As a user, I expected to send a message and see my sent message in a group.

Steps to Reproduce the Bug or Issue

  1. Send a message in a group (you can see the message)
  2. Close the bot and try to send this message again
  3. The bug started

Relevant Code

const { Client, RemoteAuth } = require("whatsapp-web.js");
const { AwsS3Store } = require("wwebjs-aws-s3");
const { S3Client, PutObjectCommand, HeadObjectCommand, GetObjectCommand, DeleteObjectCommand } = require("@aws-sdk/client-s3");
const qrcode = require("qrcode-terminal");

const s3 = new S3Client({
  region: "sa-east-1",
  credentials: {
    accessKeyId: "123", // mocked
    secretAccessKey: "123", // mocked
  },
});

const putObjectCommand = PutObjectCommand;
const headObjectCommand = HeadObjectCommand;
const getObjectCommand = GetObjectCommand;
const deleteObjectCommand = DeleteObjectCommand;

const store = new AwsS3Store({
  bucketName: "wwebjs-auth",
  remoteDataPath: "wwebjs",
  s3Client: s3,
  putObjectCommand,
  headObjectCommand,
  getObjectCommand,
  deleteObjectCommand,
});

const client = new Client({
  authStrategy: new RemoteAuth({
    clientId: "wwebjs-auth-session",
    dataPath: "./wwebjs_auth",
    store: store,
    backupSyncIntervalMs: 600000,
  }),
});

client.on("qr", (qr) => {
  qrcode.generate(qr, { small: true });
});

client.on("ready", async () => {
  console.log("Client is ready!");
  client.sendPresenceAvailable();
  const msg = await client.sendMessage("[email protected]", "Hey!"); // mocked
  console.log(msg);
});

client.on("remote_session_saved", () => {
  console.log("Saved in remote S3");
});

client.initialize();

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

OS: Linux
Phone OS: Android
whatsapp-web.js version: 1.0.2
WhatsApp Web version: 2.2405.4
Node.js Version: 18.14.2

Additional context

No response

@gxlpes gxlpes added the bug Something isn't working label Feb 6, 2024
@alechkos
Copy link
Collaborator

alechkos commented Feb 6, 2024

@gxlpes
Try to use latest WWeb version, the latest one at the moment is 2.2405.4

@gxlpes
Copy link
Author

gxlpes commented Feb 6, 2024

@gxlpes Try to use latest WWeb version, the latest one at the moment is 2.2405.4

I'm using the lastest version (as shown in my post details) but was still occuring. I also tried to hardcode the version like you said but any progress in my smartphone. The Android version of WhatsApp was is 2.24.2.76 (Android 5, Xiaomi).

My WhatsApp client in Linux is using the version 2.2405.52.

const client = new Client({
  webVersion: "2.2405.4",
  webVersionCache: {
    type: "remote",
    remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2405.4.html",
  },
  authStrategy: new RemoteAuth({
    clientId: "wwebjs-auth-session",
    dataPath: "./wwebjs_auth",
    store: store,
    backupSyncIntervalMs: 600000,
  }),
});

When I first register/login the message works but afterwards the "Waiting for this message" returns.

@roigreenberg
Copy link
Contributor

@gxlpes, have you found a solution?
I seem to have the same issue.

I send a message to a few dozen groups, and first, it takes several minutes to arrive, and even when it does, in some groups it shows the "waiting" message for another several minutes.

@Nirajan1-droid
Copy link

i think sending them in batches may resolve this problem to some extent.

@RAKESHSUVIDYA
Copy link

QR is not working properly in ubuntu platform. Is there anyone who can help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants