-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
readline: clean up event listener in onNewListener #13266
Conversation
cc/ @STRML @princejwesley LMK if you're okay with this landing under your name (as it's your code!) |
Moved the check out of the function and handled
|
Once the Readline interface is closed, the 'data' event listener should be removed. Refs: nodejs#9447 (comment)
06cf425
to
ff47f20
Compare
Changed the test to assert that there is 1 listener until you close, and 0 listeners afterwards. Not sure if that's the intended behaviour. Also not sure whether this would be |
Once the Readline interface is closed, the 'data' event listener should be removed. PR-URL: #13266 Ref: #9447 (comment) Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 7d53aba |
Once the Readline interface is closed, the 'data' event listener should be removed. PR-URL: #13266 Ref: #9447 (comment) Reviewed-By: James M Snell <jasnell@gmail.com>
I'm good with reverting but it would definitely be good to understand why it breaks things because the change is obstensibly correct ... There should not be any more data events after the close event, and there shouldn't be reason to keep the listener there. Preferably the reason for the break can be fixed so that this commit can be reapplied. |
This reverts commit 81ddeb9. Ref: nodejs#13266
For anyone reading this issue (possibly in the distant future 🛰 ), @addaleax has since answered this in #13560 (comment):
|
I'm marking this as dont-land as it appears to be reverted. Let me know if this is a mistake |
If this is a bug, then let's just fix it.
Refs: #9447 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
readline