raix-push icon indicating copy to clipboard operation
raix-push copied to clipboard

_raix_push_notifications stopped being processed

Open justinweinberg opened this issue 8 years ago • 5 comments

First of all - GREAT plugin. Thank you Raix and other contributors for making this plugin possible!! Your hard work has had a positive impact on my application.

I noticed push notifications weren't going through for my app and investigated. I saw that the _raix_push_notifications collection had stopped being processed. Push notifications were going in but not coming out.

Looking at the code, I see the following inside a Meteor.setInterval function:

      // Set send fence
      isSendingNotification = true;
      // ....
      // ....
     isSendingNotification = false;

My question is, if an error occurred between true and false, would it disable the queue until service restart? I think it would as the fence flag off would not be triggered. Note that a service restart fixed my issue which is why I was thinking perhaps this is what happened.

My mongo server is on compose.io and I wonder if the inherent unreliability of networks makes this safe to use in hosted mongo scenarios.

Any thoughts?

justinweinberg avatar Feb 27 '16 23:02 justinweinberg

I think this bit me again this week. I see stuck notifications _raix_push_notifications.

Am I thinking about the problem incorrectly?

justinweinberg avatar Mar 15 '16 21:03 justinweinberg

@justinweinberg I'm also using compose.io and also investigating why notifications aren't being sent ...

MichaelJCole avatar Mar 18 '16 04:03 MichaelJCole

If I restart my meteor app notifications start flowing again. Do yours?

I think the solution may be as simple as a try / finally around the fence. I'd fork and issue a pull request but I'm not clear on how to test this aside from going live and I'm not absolutely positive this is root cause.

justinweinberg avatar Mar 18 '16 04:03 justinweinberg

Hey @justinweinberg notifications are mission critical, so I decided to roll my own meteor package from https://github.com/phonegap/phonegap-plugin-push

MichaelJCole avatar Mar 18 '16 18:03 MichaelJCole

@justinweinberg You should make a PR. Your solution looks good and the same error is happening time to time here.

renanccastro avatar Dec 06 '17 19:12 renanccastro