Eneris / push-receiver

A library to subscribe to GCM/FCM and receive notifications within a node process.
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
16 stars 16 forks source link

Add heartbeat support, expose persistent ids #2

Closed koush closed 2 years ago

koush commented 2 years ago

This add support for heartbeat. Without this, there's no way to know if the push receiver has died due to TCP timeout on some platforms with long keepalive intervals. For example, Linux has a 2 hour interval before it sends the keep alive probe.

Eneris commented 2 years ago

Thanks for your work :) Could you please finish the work with the protobuf? I see that you've replaced the module, but code is not updated.

koush commented 2 years ago

Not sure what that was about. Had a build issue that I thought was resolved by that, but it doesn't seem to affect it. It's just a cli wrapper for protobufjs. Removed it anyways.

Eneris commented 2 years ago

That seems to be a breaking change in protobufjs package from v7. They are splitting their cli from package. I'll take your code and do some more integrating. Thanks

koush commented 2 years ago

In case you missed it, I removed that protobuf package change, so this pull request should be clean.

Eneris commented 2 years ago

Yes. Got it. Also, could you please add some test cases in jest that could verify if heartbeat is actually working? Here is a branch with some changes to your PR https://github.com/Eneris/push-receiver/tree/heartbeat

Eneris commented 2 years ago

Also. You sem to commited package-lock.json along with the yarn.lock. There must be only one and that is yarn.lock

Eneris commented 2 years ago

@koush I've resolved this PR in other branch based on the changes you've provided. Thank you. Please check out the version 3.1.0 . Hope it works for you.