Description
Issue Description
I have a background job on my parse instance which fetches an XML feed every 1 minute and sends a push notification to a specific channel every time it detects new data from the feed. I have noticed that sometimes the push is sent and sometimes it is not sent. On all cases I see that the success block is called but when I look in the parse-dashboard I see the push in the sending state.
// push to channels which usually fails.
Parse.Push.send({
channels: [channel],
data: { ...
Since I have no problem receiving push notifications on my dev instance (which only has 6 installations), on my prod instance I suspected this had to do with the fact that I am querying 40k installations where each channels record may contain 20 channels.
To prove the number of installations was the issue, I passed a query in the push request instead of using channels which would force the push to only be sent to my device
// Query pushes to only my device
var queryInstall = new Parse.Query(Parse.Installation);
queryInstall.equalTo('deviceType', 'ios');
queryInstall.equalTo('installationId', [MY_INSTALLATION_ID]);
Parse.Push.send({
where: queryInstall,
data: { ...
This query made every push a success to my device but if I remove the query and use channels instead no pushes are received. Note that although there are 40k installations, not all of them subscribe to notifications.
Steps to reproduce
Send a push to a channel observed by multiple Installation objects.
Expected Results
The push gets sent to all users.
Actual Outcome
The push notification does not get sent.
Environment Setup
-
Server
- parse-server version : 2.6.3
- Operating System: N/A
- Hardware: N/A
- Localhost or remote server? : Heroku (1 Web Dyno: 2x, 1 Worker Dyno: 2x)
-
Database
- MongoDB version: 3.2.10
- Storage engine: - Hardware:
- Localhost or remote server?: mLab, Shared cluster 1GB
Logs/Trace
verbose: REQUEST for [POST] /parse/push: {
"where": {
"channels": "CHPIncident-WestLA"
},
"data": {
"alert": {
"title": "CHP Incident West LA",
"body": "West LA: traffic Collision-unknown injury at I405 N National Blvd"
},
"chpIncident": {
"centerId": "LAHB",
"dispatchId": "LACC",
"logId": "171008LA01569",
"logTime": "Oct 8 2017 10:58AM",
"incidentId": "171008LA01569Oct 8 2017 10:58AM",
"logType": "1183-Trfc Collision-Unkn Inj",
"location": "I405 N / National Blvd",
"drivingText": " traffic Collision-unknown injury at i 4 o 5 north National boulevard ",
"drivingTextSoCal": " traffic Collision-unknown injury at the 4 o 5 north National boulevard ",
"locationDesc": "NB 405 JSO NATIONAL",
"area": "West LA",
"broadcastMessage": "West LA: traffic Collision-unknown injury at I405 N National Blvd",
"lat": 34.02685,
"lon": -118.429908,
"logDetails": [
{
"time": "Oct 8 2017 11:00AM",
"details": "[2] POSS DUPE LG/1556 -- RP STATED DESC OF VEHS ON LG/1556 WAS DIFFERENT FRM HER TC"
},
{
"time": "Oct 8 2017 10:59AM",
"details": "[1] BLK NISS ALT, BLK Q5, UNK DESC 3RD VEH"
}
],
"logUnits": []
},
"expiration_time": "2017-10-08T22:02:15.039Z",
"sound": "chp_incident.caf",
"PushType": "CHPIncident"
}
2017-10-08T18:02:17.681160+00:00 app[web.1]: } method=POST, url=/parse/push, host=carr.herokuapp.com, connection=close, user-agent=node-XMLHttpRequest, Parse/js1.9.2 (NodeJS 6.11.4), accept=*/*, content-type=text/plain, x-request-id=3cd4fcd9-ef31-4039-8507-22e00ff14637, x-forwarded-for=54.205.54.184, x-forwarded-proto=https, x-forwarded-port=443, via=1.1 vegur, connect-time=1, x-request-start=1507485737673, total-route-time=0, content-length=1307, channels=CHPIncident-WestLA, title=CHP Incident West LA, body=West LA: traffic Collision-unknown injury at I405 N National Blvd, centerId=LAHB, dispatchId=LACC, logId=171008LA01569, logTime=Oct 8 2017 10:58AM, incidentId=171008LA01569Oct 8 2017 10:58AM, logType=1183-Trfc Collision-Unkn Inj, location=I405 N / National Blvd, drivingText= traffic Collision-unknown injury at i 4 o 5 north National boulevard , drivingTextSoCal= traffic Collision-unknown injury at the 4 o 5 north National boulevard , locationDesc=NB 405 JSO NATIONAL, area=West LA, broadcastMessage=West LA: traffic Collision-unknown injury at I405 N National Blvd, lat=34.02685, lon=-118.429908, logDetails=[time=Oct 8 2017 11:00AM, details=[2] POSS DUPE LG/1556 -- RP STATED DESC OF VEHS ON LG/1556 WAS DIFFERENT FRM HER TC, time=Oct 8 2017 10:59AM, details=[1] BLK NISS ALT, BLK Q5, UNK DESC 3RD VEH], logUnits=[], expiration_time=2017-10-08T22:02:15.039Z, sound=chp_incident.caf, PushType=CHPIncident
RESPONSE from [POST] /parse/push: {
"headers": {
"X-Parse-Push-Status-Id": "wtqQ4H2N5p"
},
"response": {
"result": true
}
} X-Parse-Push-Status-Id=wtqQ4H2N5p, result=true
verbose: _PushStatus wtqQ4H2N5p: sending push to 267 installations