pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
14.53k stars 3.46k forks source link

Message.getInfo() does not show any deliveries (while WhatsApp Primary on phone shows deliveries) #3096

Open guy4261 opened 3 weeks ago

guy4261 commented 3 weeks ago

Is there an existing issue for this?

Describe the bug

With my client connected, I get my chats, for one of them - my messages, for one of the messages - its info (using getInfo()), but it is empty (=no deliveries). The entire info object is empty.

> info
{
  delivery: [],
  deliveryRemaining: 0,
  played: [],
  playedRemaining: 0,
  read: [],
  readRemaining: 0
}

Expected behavior

As this message was read by other friends in my group, I'd expect seeing them.

This is described in the official docs:

Steps to Reproduce the Bug or Issue

var chats = await client.getChats();
chats = chats.filter(c => c["isGroup"]);
var chat = chats[0];

var msgs = await chat.fetchMessages({"fromMe": true, limit: 7}) // {limit: Number, Optional}
var msg = msgs[0];

var info = await msg.getInfo();
console.log(msg.body);
console.log(info.delivery);

Relevant Code

See repro steps

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

I'm using Mac OS Sonoma 14.2 (23C64).

My phone is an iPhone SE.

As for software versions:

$ npm --version
10.2.4

$ npm version
{
  npm: '10.2.4',
  node: '21.1.0',
  acorn: '8.10.0',
  ada: '2.7.2',
  ares: '1.20.1',
  base64: '0.5.0',
  brotli: '1.1.0',
  cjs_module_lexer: '1.2.2',
  cldr: '43.1',
  icu: '73.2',
  llhttp: '9.1.2',
  modules: '120',
  napi: '9',
  nghttp2: '1.57.0',
  openssl: '3.1.3',
  simdutf: '3.2.18',
  tz: '2023c',
  undici: '5.26.4',
  unicode: '15.0',
  uv: '1.46.0',
  uvwasi: '0.0.19',
  v8: '11.8.172.15-node.14',
  zlib: '1.2.11'
}

Additional context

No response

guy4261 commented 3 weeks ago

Some updates -

  1. After trying getInfo over a larger amount of messages and chats, it is not always empty, but does tend to be inaccurate (empty/partial list compared to what I see on WhatsApp Primary).

  2. This is my client configuration. I'm using this webVersionCache.remotePath to overcome a bug (picked this from here). Perhaps that's part of my problem?

const client = new Client({
    authStrategy: new LocalAuth(),
    webVersionCache: {
        type: "remote",
        remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2412.54.html",
    },
    puppeteer: {
        // args: ['--proxy-server=proxy-server-that-requires-authentication.example.com'],
        headless: false
    }
});
  1. When Chromium starts (I'm not running headless for now), WhatsApp Web asks for an update. Might this be related?
  2. Screenshot 2024-06-12 at 8 54 07

Thanks! Hope this additional information helps.

sagirr commented 1 week ago

solve this :

npm install whatsapp-web.js@latest

webVersionCache: {
        type: 'remote',
        remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2413.51-beta.html',
   }