-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with multiple event listeners, duplicated event triggers #2485
Comments
Version |
I have reproduced the same issue described above (title/description) in version 1.3.4 and 1.3.5. This issue has not been resolved. I also checked other issues submitted after the issue above had been submitted but I it seemed that this issue had never been resolved in newer versions. I will submit a new issue describing my scenario with the same underlying problem. |
Getting this error with version "^1.7.1" |
Is there any movement on this issue or a workround suggested? |
https://ethereum.stackexchange.com/questions/15402/duplicate-events-firing-in-a-web3-listener 3rd response worked for me, by creating a Set. |
Thanks, yes, I have ended up doing the same and using the tranactionHash as a sort of idempotency token. But it it a kludge, isn't it? I can't really see a blockchain reason why I would get multiple events, and certainly no link to the number of discrete event handlers I have. That sounds like a bug to me. I also tried different ways of subscribing to events, but web3 seems to propagate many events. This issues was marked as closed, maybe we should re-open it. |
I've tried the 3rd response as well, but even that is not working for me. |
In my app i have multiple listeners (watchers) on different events of same contract. Nothing complicated.
Problem is that same event is caught multiple times, and strange thing is that event is caught exactly number_of_listeners times.
So in this case i have two listener on two different events and triggered listener is triggered 2 times
Tried with 3 listeners, then is triggered 3 times.
(Not all of them are triggered, just one listener multiple times).
I read this article #398 but doesn't explain why there is correlation between number of listeners and multiplication of event triggers.
Forgot to mention, console.log is called from same .js file and same line in that file.
Does somebody have an idea why is this happening??
I looking for answer about 5 months now , also i asked
https://ethereum.stackexchange.com/questions/62799/problem-with-multiple-event-listeners-duplicated-event-triggers?noredirect=1#comment79711_62799.
I don't know if this is a bug or i'm doing something wrong.
The text was updated successfully, but these errors were encountered: