Skip to content

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

@AbdelrahmanHafez

Description

@AbdelrahmanHafez

On node 14 streams close automatically which caused cursor.on('close', callback); to call callback twice, since we emit 'close' manually in mongoose.

To fix this we need to check whether the cursor is destroyed or not, if destroyed, do nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions