Describe the Bug
graphql-subscriptions dependency has a Promise memory leak that was fixed with pull request: https://github.com/apollographql/graphql-subscriptions/pull/209
Problem is, this pull request is over a year old and it seems it won't be merged in.
We were solving this issue by installing specific graphql-subscriptions version (github:urossmolnik/graphql-subscriptions#v1.3.0) and making sure package-lock file is properly "deduped" (npm dedupe) so version v1.1.0 of graphql-subscriptions package is not installed locally for type-graphql package.
This does not solve our problem anymore with npm 7 - something to do with SemVer for packages installed directly from Git.
To Reproduce
Start a subscriber to a subscription which rejects messages and start publishing messages. You'll notice memory keeps increasing. Memory profile will confirm.
Do the same thing using github:urossmolnik/graphql-subscriptions#v1.3.0 and you'll notice memory is not increasing.
Expected Behavior
Not have a memory leak :)
Not sure what the solution would be. Are we missing something or would removing graphql-subscription dependency be the only solution?
Problem is, this pull request is over a year old and it seems it won't be merged in.
So it's time for community to fork and maintain the updated version 馃槈
This does not solve our problem anymore with npm 7 - something to do with SemVer for packages installed directly from Git.
So go ask npm team about overriding dependencies like a yarn can do 馃槢
Not sure what the solution would be.
I have no idea too 馃檮
Maybe in v2.0.0 I'll integrate custom subscriptions engine with compatible API for other pubsub addons (redis, etc.).
Closing for a housekeeping purposes 馃敀
Most helpful comment
So it's time for community to fork and maintain the updated version 馃槈
So go ask npm team about overriding dependencies like a yarn can do 馃槢
I have no idea too 馃檮
Maybe in v2.0.0 I'll integrate custom subscriptions engine with compatible API for other pubsub addons (redis, etc.).