andreialecu / node-apn-http2

Communicate with Apple Push Notification Service via native Node.js v8.8.1+ HTTP2 module (node-apn drop-in)
MIT License
27 stars 10 forks source link

Seeing econnReset with node 10 #10

Open arupadhy opened 5 years ago

arupadhy commented 5 years ago

we started noticing this after upgrade to node 10 I am digging more into this library code base...Is there a recommended way to avoid econnreset if other end of tcp socket is closed abruptly?

mihai-iorga commented 5 years ago

This happens with node 8 also (recently), they (Apple) changed something ... again ..

andreialecu commented 5 years ago

Could be an intermittent issue with Apple's servers. I haven't noticed issues personally.

Perhaps apple fixed it on their end?

arupadhy commented 5 years ago

@andreialecu i think the library isn't handling scenarios where 'other end of socket is abruptly closed'....I see an open pull request that tries to catch the error at 'session' level...that fixes the problem of other apps (depending on this library) not to register events at process level.

Would be better to simply reject the promise for such cases (might require little bit of refactoring)...Let me know if you are open to reviewing a mr