open-cli-tools / concurrently

Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
https://www.npmjs.com/package/concurrently
MIT License
7.01k stars 228 forks source link

Don't set up more than 1 abort signal listener #503

Closed gustavohenke closed 6 days ago

gustavohenke commented 1 week ago

🤦 Rxjs' fromEvent creates a new listener on every subscription, but this is a bit hidden because the abort signal isn't subscribed to directly:

https://github.com/open-cli-tools/concurrently/blob/a7a5894e2daf9dd64059200cc1c53c756412b3cd/src/completion-listener.ts#L96-L109

Sounds like just sharing the underlying source observable is enough.

Fixes #502

coveralls commented 1 week ago

Coverage Status

coverage: 98.263%. remained the same when pulling 74cc2f2df6be9b231f601982faae5a4adc95575a on abortsignal-leak into a7a5894e2daf9dd64059200cc1c53c756412b3cd on main.