whatsapp-web.js
whatsapp-web.js copied to clipboard
Bug: fetchMessage Function Does Not Update Message ACK Status Properly
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
When invoking the fetchMessage
function in the whatsapp-web.js library to retrieve messages, it is observed that the ack property of the retrieved messages does not update correctly. The ack property should reflect the status of the message delivery confirmation, with numeric values according to the specification: ACK_ERROR
: -1, ACK_PENDING
: 0, ACK_SERVER
: 1, ACK_DEVICE
: 2, ACK_READ
: 3, ACK_PLAYED
: 4.
Expected behavior
We expect that when invoking fetchMessage
and then marking the messages as read using the Chat.SendSeen
function, the ack property of the messages updates correctly to ACK_READ (3) to reflect that they have been read.
Steps to Reproduce the Bug or Issue
- Receive a message from a user in a chat.
- Mark the chat as read using the
Chat.SendSeen
function. - Retrieve the messages with the
fetchMessage
function. - Check the value of the
ack
property of the retrieved messages.
Relevant Code
chat.sendSeen();
await chat.fetchMessages({limit: limit}).then(async(messages) => {
messages = messages.filter(msg => msg.ack <= 2); // It is not the ack property of the messages updated correctly to ACK_READ (3)
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
Linux, Phone Android, main whatsapp-web.js versión, Wathsapp: 2.2407.2
Additional context
No response
@elhumbertoz on your side still have the problem? because on my side, sometimes ACK is still not updated.