Which @angular/* package(s) are the source of the bug?
zone.js
Is this a regression?
No
Description
Zone.js tries to be clever and creates a single handler for all listeners to the same event on the same target that have the same capture setting.
However, with the somewhat recent addition of the signal setting, this means that handlers can improperly registered, consider the following two tests:
const controller = new AbortController();
window.addEventListener('myEvent', () => console.log('expected'));
window.addEventListener('myEvent', () => console.log('unexpected'), {signal: controller.signal});
controller.abort();
window.dispatchEvent(new Event('myEvent'));
// LOG: 'expected'
// LOG: 'unexpected'
const controller = new AbortController();
window.addEventListener('myEvent', () => console.log('unexpected'), {signal: controller.signal});
window.addEventListener('myEvent', () => console.log('expected'));
controller.abort();
window.dispatchEvent(new Event('myEvent'));
// nothing logs
If zone.js is not installed, only 'expected' is logged in each case.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
No response
Anything else?
No response
Which @angular/* package(s) are the source of the bug?
zone.js
Is this a regression?
No
Description
Zone.js tries to be clever and creates a single handler for all listeners to the same event on the same target that have the same
capturesetting.However, with the somewhat recent addition of the
signalsetting, this means that handlers can improperly registered, consider the following two tests:If zone.js is not installed, only
'expected'is logged in each case.Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version)No response
Anything else?
No response