appfeel/node-pushnotifications

Pump version of node-apn to 3.x in order to remove the memory leak

Closed this issue · 21 comments

Currently, node-apn is in version 2.2 thus, it lead to this issues node-apn/node-apn#518. Please pump the version up so we can resolve it. Thanks

Same issue as #44.

@bubuzzz Updating to node-apn 3.x will result in the library only being compatible with node 8.8.x+. Hence this should be considered rather carefully. Are there other known fixes for node-apn 2.x ? Like #55 ?

Just a reminder that I have a fork of this repo running with node-apn-http2 builtin... running with zero issues. Considering this issue is still open and people are trying to modernize, feel free to use this instead. And of course, it requires node 8.8.1+.

@appfeel appears to be off the grid right now, so if anyone wants an alternative that is proven to work in production:

npm install node-pushnotifications-http2

https://github.com/streaka/node-pushnotifications-http2

@jpike88 : I am using Lambda + node v8.10. I used node-pushnotifications-http2. However I am facing the same issue. Is it working for you?

That fork I linked works with no issues.

@jpike88 is it possible to adapt modifications to this plugin? could you point us where is the memory leak? Thanks!

I still don't know exactly what the nature of the memory leak is, all I know is that the native version of http2 seems to have fixed it

Hello good people,
I ran into similar issues, memory leaks with event emitters preventing my script from exiting, hence leading to issues when running the script multiple times

I was wondering if you had issues when running node-apn with a nodejs server that keeps running? Or does it happen when closing only?

Any updates on this? The memory leaks are still present.

@jpike88 Do you plan on catching up your fork and publishing?

Nope, works like a charm in heavy production environments. ‘if it ain’t broke’...

If there’s a big incentive for me to upgrade it I’ll take a look but it handles iOS and Android notifications fine

There have been many bug fixes and issues addressed since May-6 2017 (the date of the last merged commit in the -http2 fork). In particular for me, #58.

Possible solutions:

Waiting for node-apn/node-apn#518 to be solved... Right now it seems there is no interest on solving it.

@jpike88 can you please open issues for your fork?

Done.

@miqmago The fork just uses the native http2 library bundled with node 8.8.1+, which seems to have eliminated the memory leak warning. Not sure how it works either, it was initially just an experiment but it's been on production for quite a while now, no issues.

With version 1.2.0 we migrated to https://www.npmjs.com/package/@parse/node-apn which is an actively maintained fork of node-apn.
Does the memory leak still persist with the new release?

good question! I'll move back to main branch now and see how it flies

@jpike88 any update on this?

Sorry, I've been too busy, I got part way in and then some business shit hit the fan and I haven't touched it since.

Feel free to give it a go... bear in mind that my fork only touched the library's code very lightly, I probably don't have any deeper understanding of the code than you.

Has this already been resolved? I'm a bit confused because package.json does in fact reference node-apn version 3.1.0.

@derwaldgeist We upgraded to a fork of node-apn that should be maintained more actively than the original one. I assume the issue is resolved until we hear otherwise :)