Skip to content

Bugfix multiple event listeners with the same name#2165

Merged
Henry-E merged 4 commits into
otter-sec:masterfrom
filipzeta:bugfix-multiple-event-listeners
Nov 16, 2022
Merged

Bugfix multiple event listeners with the same name#2165
Henry-E merged 4 commits into
otter-sec:masterfrom
filipzeta:bugfix-multiple-event-listeners

Conversation

@filipzeta

Copy link
Copy Markdown
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

vercel Bot commented Sep 5, 2022

Copy link
Copy Markdown

@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

xjcaa commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

@armaniferrante could we merge this fix in please?

@Henry-E

Henry-E commented Nov 16, 2022

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

@Henry-E Henry-E merged commit 5c474c6 into otter-sec: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
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
* 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