-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Issue with sending pushes from Parse Server #1245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with sending pushes from Parse Server #1245
Comments
Try running with |
How was the push sent? From the |
Here is the log that this generates when sending a Push (omitted some info):
It was sent using the Parse.Push.send() function in Cloud Code. |
Update: I figured out this line causes a error leading to the code not to continue:
For some reason in this line of code the reduce call fails because the installations object is undefined according to the log. (can't call reduce on an undefined object.) even though the installations object seems to be defined because if I comment out this block (line 100-123) the rest of the push notification process using the installations object works fine. |
so when you console.log(installations) it says undefined? can you check https://github.com/ParsePlatform/parse-server/blob/master/src/Controllers/PushController.js#L93 if response is properly set? |
I have added a few lines of logging and error catching like this:
This results in the following log:
|
Any idea what's going on? What's the error stack? maybe it's badgeInstallationsMap[badge] that is undefined and the library below doing the reduce |
After some more debugging I managed to narrow it down to the following code block in the GCM.js file:
I also figured out the reason why devices is undefined here. This will make it so the It seems the way to solve this is to either do a undefined/empty check on the devices parameter in I have added a pull request using the latter solution to the parse-server-push-adapter over here |
Nice tracking down! Thanks for the debugging. We'll close that one when we merge |
Parse Server Environment Setup
Node.JS 4.4
Python 2.7.11
Parse Server 2.2.2
Self hosted MongoDB 3.0.10-1.5 (Storage engine: Rocksdb)
Debian 8
Description of issue
Currently we having an issue with push notifications sent from Parse Server cloud code. Sending out push notifications does not work and the Parse.com dashboard starts showing issues when _PushStatus entries created by parse-server are present in the database.
While migrating to our own Parse Server we are still sending Push notifications from our hosted Parse.com Cloud Code environment. This still works fine even with a self-hosted MongoDB instance.
The first issue encountered in Parse Server is that push notifications aren't being sent out properly. The status of the push is stuck on Running with 0 pushes being sent out (on an audience of about 800-1000 pushes).
The second issue is that once a _PushStatus entry is created by Parse Server, the Parse.com hosted dashboard doesn't list any push entries on the push tab anymore. It just shows a message "No pushes to display yet. You may need to configure push notifications for your app." until all _PushStatus entries created by Parse Server are removed from the database (or end up on the second page of the push list, therefore allowing the first page to load properly again).
The Parse.com hosted code and our Parse Server code calling Parse.Push.send() is identical. Both environment use the same connection string to query and manipulate the self hosted MongoDB instance. Both environments also use the same apn push certificates/gcm sender ids
Logs/trace
Here is an example of a _PushStatus entry sent from Parse.com hosted cloud code that succeeded:
And here is a _PushStatus entry sent from Parse Server Cloud Code that failed (stuck on "running" status).
The text was updated successfully, but these errors were encountered: