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.21k stars 3.63k forks source link

why chat.fetchMessages only return one message of e2e_notification #2475

Closed NightRannie closed 10 months ago

NightRannie commented 1 year ago

Is there an existing issue for this?

Describe the bug

the question happen to my whatsapp account From Android to IOS ,scan qrcode to login success, used chat.fetchMessages only get one message of e2e_notification, how to get all message 微信截图_20230906114950 微信截图_20230906115158

Expected behavior

get all message list

Steps to Reproduce the Bug or Issue

1 client.initialize 2 scan code 3 chat.fetchMessages

Relevant Code

const { clientId, options } = data const chat = await this.getChatById(options.chatId, clientId) const messages = await chat.fetchMessages({ limit: options.limit, // is 999 fromMe: false }) || []

logger.info(messages, 'messages----')

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS:electron vue for Window
Phone OS: iOS whatsapp-web.js version:1.22.1 WhatsApp Web version [run await client.getWWebVersion()]: Node.js Version:16.17.0

Additional context

No response

scrawner commented 1 year ago

same issue here... Im trying to get unread messages using fetchMessages

When I run this script right after client.onready it works, but whenever I run the script in any other moment it's not working.

alechkos commented 10 months ago

Duplicate of #1325