Coder Social home page Coder Social logo

socket.removeEventListener('close',..) not present in 4.1.2, (maybe) reason for MaxListenersExceededWarning from Node about graphql-ws HOT 3 CLOSED

enisdenjo avatar enisdenjo commented on May 18, 2024
socket.removeEventListener('close',..) not present in 4.1.2, (maybe) reason for MaxListenersExceededWarning from Node

from graphql-ws.

Comments (3)

enisdenjo avatar enisdenjo commented on May 18, 2024 1

Hey hey, thanks for reporting this issue! Nope, I am indeed subscribing to the same event on each subscription which causes Node to raise this warning. As you may noticed I am already attempting to fix this with the open draft PR, bear with me! 😄

from graphql-ws.

enisdenjo avatar enisdenjo commented on May 18, 2024 1

🎉 This issue has been resolved in version 4.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

from graphql-ws.

enisdenjo avatar enisdenjo commented on May 18, 2024

Just a short update, the referenced PR solves the 'close' listener warnings. However, we do create 'message' listeners on subscribe too - I guess they would raise the same warning.

So, as soon as I get rid of the 'message' listener - I'll merge the PR and effectively get rid of all potential MaxListenersExceededWarning warnings.

P.S. The reason why v4.1.1 raised no warnings for you, even though the 'message' listeners stayed exactly the same, is because your tests showcase single-result queries. As soon as you run the same example, but with streaming operations, a second warning would be raised pointing to the 'message' listeners.

from graphql-ws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.