wppconnect-team / wa-js

WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
https://wppconnect.io/wa-js/
Apache License 2.0
408 stars 129 forks source link

WPP.chat.getMessageACK on deleted Message return Unhandled Promise Error #2053

Closed ariona closed 3 months ago

ariona commented 3 months ago

WA-JS Version

3.4.1

WhatsApp Version

2.3000.1014553850

Browser Version

126.0.6478.127

Operation System

OS X Sonoma

Steps to reproduce

  1. Send message and get message id
  2. Delete the message
  3. get Message Ack using message id from step 1 await WPP.chat.getMessageById('true_6281224630779@c.us_3EB0548176F515E61DA688_out')
  4. you will get unhandled promise error since the message is not exist

What is expected?

The function should handle promise error and return null/undefined when the message id is not found

What is actually happening?

Instead returning falsy value like null/undefined, it log Unhandled Promise Error

wpp.js:2 Uncaught (in promise) 
TypeError: e.remote.isStatusV3 is not a function
    at t.getMessageById (core.js:2:143740)
    at t.getMessageACK (core.js:2:142832)

Any additional comments?

No response

marcelo386 commented 3 months ago

está função deve ter mudado de nome i.Wid.isStatusV3, existe fiz ajuste direto no arquivo final, só pra não erro, mas precisa analisar o que mudou

//participant: i.Wid.isGroup(e.from) || i.Wid.isGroup(e.to) || i.Wid.isStatusV3(r) ? e.quotedParticipant : void 0 participant: i.Wid.isGroup(e.from) || i.Wid.isGroup(e.to) || (i.Wid.isStatusV3 ? i.Wid.isStatusV3(r) : undefined) ? e.quotedParticipant : void 0

icleitoncosta commented 3 months ago

Fixed by https://github.com/wppconnect-team/wa-js/commit/dfae74de3751d091b5626da90d0df75381873eab

ariona commented 3 months ago

Fixed by dfae74d

@icleitoncosta this has not been resolved 3.4.2-alpha.0 release. still return error:

TypeError: n.isStatusV3 is not a function
    at t.getMessageById (core.js:2:143907)
    at t.getMessageACK (core.js:2:142840)
    at ui.js:557:20145
    at new Promise (<anonymous>)

reference to this. n.isStatusV3 at the end of line

if ((null === (r = null === (t = e.remote) || void 0 === t ? void 0 : t.toString()) || void 0 === r ? void 0 : r.includes("status@broadcast")) || (null === (n = e.remote) || void 0 === n ? void 0 : n.isStatusV3()))