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

Fix issues with adding/removing SIGINT listeners #710

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

WesCossick
Copy link
Contributor

Closes #709

This PR fixes the problem where Listr is removing all SIGINT listeners, instead of just the listeners it manages. I added a "should not clear other SIGINT listeners" test and verified it failed prior to implementing the fix. Now the test passes.

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.25%. Comparing base (cc812f0) to head (0d30480).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #710   +/-   ##
=======================================
  Coverage   82.25%   82.25%           
=======================================
  Files          37       37           
  Lines         896      896           
  Branches      231      231           
=======================================
  Hits          737      737           
  Misses        119      119           
  Partials       40       40           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cenk1cenk2
Copy link
Collaborator

Hmm really interesting if we you wrap whole thing and put in a variable then it finds it.

Thank you for your work on this. Can you just reword the commit to start with fix: instead of the current form so semantic release publishes it.

@WesCossick
Copy link
Contributor Author

Sure, I've just updated the commit message to start with fix:.

@cenk1cenk2 cenk1cenk2 merged commit 5f4bd66 into listr2:master Mar 29, 2024
5 checks passed
@cenk1cenk2
Copy link
Collaborator

🎉 This PR is included in version 8.1.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@cenk1cenk2
Copy link
Collaborator

🎉 This PR is included in version 2.0.5 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@cenk1cenk2
Copy link
Collaborator

🎉 This PR is included in version 2.0.5 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@WesCossick
Copy link
Contributor Author

@cenk1cenk2 Thanks for releasing this so quickly! While our company was working on integrating the new release into one of our projects, I noticed there's a lingering process.removeAllListeners('SIGINT') call in the signalHandler() function... Unfortunately, I didn't notice it when I was working on this MR. I suspect it's not needed at all, since you don't need to call process.removeListener() when you're using process.once() to add the listener in the first place.

Do you think it should be removed?

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

Successfully merging this pull request may close these issues.

[Bug]: SIGINT listener added, but not removed, causing unwanted behavior
3 participants