Skip to content

Conversation

@AbdelrahmanHafez
Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez commented Apr 22, 2020

fixes #8835

@AbdelrahmanHafez
Copy link
Collaborator Author

For some reason stream.on('close', cb); calls the callback twice on node 14, not sure if this is a bug in mongoose or node 14, will dig some more into this.

The test passes by replacing stream.on(...) with stream.once(...), but I am sure there are users out there who are relying on stream.on(...) working correctly.

@AbdelrahmanHafez AbdelrahmanHafez changed the title add node 13, and 14 to travis add node 13, and 14 to travis, and fix stream close event listener called multiple times on node 14 Apr 22, 2020
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. I haven't been able to find much about the changes to streams in Node 14 beyond this article: https://medium.com/@nodejs/node-js-version-14-available-now-8170d384567e . But since tests pass I think this should work.

@vkarpov15 vkarpov15 added this to the 5.9.11 milestone Apr 24, 2020
@vkarpov15 vkarpov15 merged commit 7e26e16 into Automattic:master Apr 24, 2020
@AbdelrahmanHafez AbdelrahmanHafez deleted the patch-1 branch April 24, 2020 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] closing a cursor on Node 14 calls on('close', callback); twice

2 participants