Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
514 stars 197 forks source link

Mongo primary election results in stopped delivery #343

Closed geekgonecrazy closed 5 years ago

geekgonecrazy commented 5 years ago

If you are running a multi-node mongo cluster and then the primary node steps down, the raix:push package stops sending notifications.

To resolve you have to restart the meteor app and then it will notice all of the items in the queue and rapidly send them out.

My suspicion...

The sendWorker is in the middle of sending when the election happens and this mongo query fails: https://github.com/raix/push/blob/master/lib/server/push.api.js#L685

Resulting in this: https://github.com/raix/push/blob/master/lib/server/push.api.js#L673 still equaling true. So it never attempts to send a notification again.

sampaiodiego commented 5 years ago

I have published a forked version with the fix https://atmospherejs.com/rocketchat/push repo at https://github.com/RocketChat/push