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
14.62k stars 3.48k forks source link

Message_reaction event is not being emitted #3063

Closed rbkayz closed 1 month ago

rbkayz commented 1 month ago

Is there an existing issue for this?

Describe the bug

The message_reaction event is not being emitted by the injected store

Expected behavior

Previously, when you send a reaction on any message, it would emit the message_reaction event with the Reaction model. This has now stopped (in 2.300x) versions

Steps to Reproduce the Bug or Issue

  1. Create a session via wwebjs
  2. Listen to the message_reaction event:

client.on('message_reaction', (reaction) => console.log(reaction))

  1. Check if the reaction is being logged

Relevant Code

No response

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Linux Phone OS: Android whatsapp-web.js version: exodus WA Web version: 2.3000.1013775787 Node.js version: 18x

Additional context

No response

Itay-Sharoni commented 1 month ago

Same issue for me I use two different WA accounts

1 is working fine 2 has no reaction events

joweste commented 1 month ago

I have the same problem

gabrielnogueiracsc commented 1 month ago

i have the same problem, identified today! any workaround?

rbkayz commented 1 month ago

None so far. :/

jrocha commented 1 month ago

This branch (https://github.com/jrocha/whatsapp-web.js/tree/webpack-exodus-fix-reaction) has message_reaction working on 2.3000.x; Not sure if this breaks 2.2xxx. Will submit a PR as soon as I find way to deal with version check on ExposeStore.

rbkayz commented 1 month ago

You're a star.

If you don't mind, could you tell us how you debugged it? So I can also contribute in the future.

I broke my head over the CreateOrUpdateReactionsModule

I even tried to use test with another module called WaWebReactionsCollection, but even that obviously didn't work

N0N4M3BNS commented 1 month ago

Any solution for this bug?

rbkayz commented 1 month ago

This branch (https://github.com/jrocha/whatsapp-web.js/tree/webpack-exodus-fix-reaction) has message_reaction working on 2.3000.x; Not sure if this breaks 2.2xxx. Will submit a PR as soon as I find way to deal with version check on ExposeStore.

This solves the issue

N0N4M3BNS commented 1 month ago

@rbkayz It does not work when I use it, but the update to any branch, right?

rbkayz commented 1 month ago

Use it on exodus

jrocha commented 1 month ago

@rbkayz don't think the issue should be closed yet. I'm still looking for help to make changes compatible with previous versions and make a PR.

jrocha commented 1 month ago

You're a star.

If you don't mind, could you tell us how you debugged it? So I can also contribute in the future.

I broke my head over the CreateOrUpdateReactionsModule

I even tried to use test with another module called WaWebReactionsCollection, but even that obviously didn't work

I've searched the source for text "Reaction" and placed some breakpoints around. Sent a reaction and checked the call stack when the break hit.

rbkayz commented 1 month ago

@rbkayz don't think the issue should be closed yet. I'm still looking for help to make changes compatible with previous versions and make a PR.

Makes sense. Reopened it. Thank you

alechkos commented 1 month ago

Fixed in #3099

N0N4M3BNS commented 1 month ago

I'm using message_reaction to capture the reaction. But it did not return any reaction to me, and my web version is 2.3000.1014177466.

UPDATED: I try using whatsapp web and try send reaction can't it too. This whatsapp web version is 2.3000.1014187303

image
jrocha commented 1 month ago

@N0N4M3BNS do you know if this error is only happening with the new code? do you have detailed repro steps?

jrocha commented 1 month ago

@N0N4M3BNS could pls try this new PR. Should fix your issue.

N0N4M3BNS commented 1 month ago

@jrocha Try already, working fine. Thanks