Wildcard listener not invoked when also matching exact listener
See original GitHub issueIf an event matches both a listener with a wildcard and a listener without, only the non-wildcard listener is invoked. A wildcard listener should not be dependent on if another listener has a “better match”. If this is actually intended behaviour, maybe an option on the constructor could provide both.
Steps to reproduce:
const EventEmitter2 = require('eventemitter2');
const ee = new EventEmitter2({ wildcard: true });
ee.on('A', console.log);
ee.on('B.**', console.log);
ee.on('C', console.log);
ee.on('C.**', console.log);
ee.emit('A', 'A'); // Logs "A" once
ee.emit('B', 'B'); // Logs "B" once
ee.emit('C', 'C'); // Logs "C" only once, not matching wildcard C.**
Expected result A B C C
Actual result A B C
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Acknowledging the message on wildcard-address does not ...
Once the processing is successful at the listener, the message is acknowledged at the wildcard-address ( /queue/app/* ), but not the original ...
Read more >Listeners for your Application Load Balancers
Wildcard characters are not supported; therefore, the method name must be an exact match. We recommend that you route GET and HEAD requests...
Read more >Listener components (proto) - Envoy Proxy
FilterChainMatch. Specifies the match criteria for selecting a specific filter chain for a listener. In order for a filter chain to be selected,...
Read more >Configure HTTP Listener Source - Mule 4
Wildcards at the end of a path can help provide better error messages by capturing requests to unmanaged resources. Parameters ( {param} )...
Read more >Using the EventManager - Zend Framework 2 - Read the Docs
This is because those are often not stored in the object, and also to ensure the listeners have the exact same context as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DigitalBrainJS Thank you! Just released v6.4.5 on NPM. 😁
@thorsby Thanks for reporting! I have just fixed this bug and when @RangerMauve has time he will release a new v6.4.5 version with this change.