Skip to content
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

Bugfix multiple event listeners with the same name #2165

Merged
merged 4 commits into from
Nov 16, 2022

Conversation

filipzeta
Copy link
Contributor

This PR solves issue 2161:
#2161

With this change applied:

...
Add event listener, eventName= TradeEvent
...
Add event listener, eventName= OrderCompleteEvent
...
Add event listener, eventName= TradeEvent
this._eventListeners before: Map(2) { 'TradeEvent' => [ 0 ], 'OrderCompleteEvent' => [ 1 ] }
this._eventCallbacks before: Map(2) {
  0 => [ 'TradeEvent', [Function (anonymous)] ],
  1 => [ 'OrderCompleteEvent', [Function (anonymous)] ]
}
this._eventListeners after: Map(2) { 'TradeEvent' => [ 0, 2 ], 'OrderCompleteEvent' => [ 1 ] }
this._eventCallbacks after: Map(3) {
  0 => [ 'TradeEvent', [Function (anonymous)] ],
  1 => [ 'OrderCompleteEvent', [Function (anonymous)] ],
  2 => [ 'TradeEvent', [Function (anonymous)] ]
}
...

The important bit is that this._eventListeners gets properly concatenated, compared with the logs in the issue 😊

@vercel
Copy link

vercel bot commented Sep 5, 2022

@filipzeta is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@xjcaa
Copy link
Contributor

xjcaa commented Oct 28, 2022

@armaniferrante could we merge this fix in please?

@Henry-E
Copy link

Henry-E commented Nov 16, 2022

  • Fixes a bug
  • doesn't change very much code
  • tests pass
    It's a merge!

@Henry-E Henry-E merged commit 5c474c6 into coral-xyz:master Nov 16, 2022
Henry-E pushed a commit to Henry-E/anchor that referenced this pull request Dec 6, 2022
* Bugfix multiple event listeners with the same name

* Changelog

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants