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
15.54k stars 3.7k forks source link

Chat history not showing And Auto Reply stops working. #1736

Closed nandaaxyz closed 2 years ago

nandaaxyz commented 2 years ago

Is there an existing issue for this?

Describe the bug

After getting chromium opening web.whatsapp.com. The chat history doesn't show up. like this image. gambar

also, auto reply chat also doesn't get catch by

client.on('message', async msg => {

gambar

This issue is found on v1.18.0-alpha.1 v1.17.1 both whatsapp standard and whatsapp bussinuess account. And there is this button on web.whatsapp.com to update the apps. But it always crash after pressing that button. gambar

Weirdly, if I manually opening web.whatsapp.com on chromium, the chat history actually show up.

Expected behavior

Chat history show up and whatsapp bot can catch every incoming chat.

Steps to Reproduce the Bug or Issue

  1. open whatsapp-web directory
  2. open command promt, type "node example.js"
  3. web whatsapp loaded on chromium loaded.
  4. Scan QR
  5. there, the chat history not showing up. also the auto reply chat do not work.

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS : Windows 10 Phone OS: MIUI 13 whatsapp-web.js version v1.18.0-alpha.1 and v1.17.1 Web-whatsapp version 2.2240.7 Node.js version 18.8.0

Additional context

No response

nandaaxyz commented 2 years ago

After, upgrading and downgrading again pupeteer to version 17.0.0 back to 13.0.0. It works again.

What I found is, now my web.whatsapp version is on 2.2238.7 not 2.2240.7.

I think the problem is whatsapp-web.js not working on web.whatsapp version 2.2240.7 yet?

crazytweeks commented 2 years ago

Clearing session or clearing pupeteer user-data and login again fixes the issue. It maybe because of whatsapp version change.

nandaaxyz commented 2 years ago

Clearing session or clearing pupeteer user-data and login again fixes the issue. It maybe because of whatsapp version change.

I will keep in mind to do that, if the problem occurred again.

eduardoa1ves commented 2 years ago

As a stopgap I made the following modifications and works for me:

https://github.com/pedroslopez/whatsapp-web.js/issues/1741#issuecomment-1284715884

nandaaxyz commented 2 years ago

As a stopgap I made the following modifications and works for me:

#1741 (comment)

Thanks, I have tried it. but what does the modification actually does anyway?

JuniorRibas commented 2 years ago

Inside the src/util/Injected.js file

on line 230 add this code

const ephemeralSettings = { ephemeralDuration: undefined, ephemeralSettingTimestamp: undefined, disappearingModeInitiator: undefined, };

on line 370 comment this code

// msg.links = (message.getLinks()).map(link => ({ // link: link.href, // isSuspicious: Boolean(link.suspiciousCharacters && link.suspiciousCharacters.size) // }));

PurpShell commented 2 years ago

Seems resolved, use the latest versions (1.18.2)