whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

Bug: fetchMessage Function Does Not Update Message ACK Status Properly

Open elhumbertoz opened this issue 1 year ago • 2 comments

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

  1. Receive a message from a user in a chat.
  2. Mark the chat as read using the Chat.SendSeen function.
  3. Retrieve the messages with the fetchMessage function.
  4. 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 avatar Feb 17 '24 00:02 elhumbertoz

@elhumbertoz on your side still have the problem? because on my side, sometimes ACK is still not updated.

N0N4M3BNS avatar May 09 '24 03:05 N0N4M3BNS