{"action":"created","issue":{"url":"https://api.github.com/repos/parse-community/parse-server/issues/4242","repository_url":"https://api.github.com/repos/parse-community/parse-server","labels_url":"https://api.github.com/repos/parse-community/parse-server/issues/4242/labels{/name}","comments_url":"https://api.github.com/repos/parse-community/parse-server/issues/4242/comments","events_url":"https://api.github.com/repos/parse-community/parse-server/issues/4242/events","html_url":"https://github.com/parse-community/parse-server/issues/4242","id":263693013,"number":4242,"title":"Sending push notifications with 40k installations fails ","user":{"login":"adammlevy","id":599680,"avatar_url":"https://avatars0.githubusercontent.com/u/599680?v=4","gravatar_id":"","url":"https://api.github.com/users/adammlevy","html_url":"https://github.com/adammlevy","followers_url":"https://api.github.com/users/adammlevy/followers","following_url":"https://api.github.com/users/adammlevy/following{/other_user}","gists_url":"https://api.github.com/users/adammlevy/gists{/gist_id}","starred_url":"https://api.github.com/users/adammlevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adammlevy/subscriptions","organizations_url":"https://api.github.com/users/adammlevy/orgs","repos_url":"https://api.github.com/users/adammlevy/repos","events_url":"https://api.github.com/users/adammlevy/events{/privacy}","received_events_url":"https://api.github.com/users/adammlevy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-10-08T04:52:50Z","updated_at":"2017-10-08T21:14:24Z","closed_at":null,"author_association":"NONE","body":"### Issue Description\r\n\r\nI 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.  \r\n\r\n```\r\n// push to channels which usually fails.  \r\nParse.Push.send({\r\n\t\tchannels: [channel],\r\n\t\t\tdata: { ...\r\n```\r\n\r\nSince 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. \r\nTo 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\r\n\r\n```\r\n// Query pushes to only my device\r\nvar queryInstall = new Parse.Query(Parse.Installation);\r\nqueryInstall.equalTo('deviceType', 'ios');\r\nqueryInstall.equalTo('installationId', [MY_INSTALLATION_ID]);\r\n\r\nParse.Push.send({\r\n\twhere: queryInstall,\r\n\tdata: { ...\r\n```\r\n\r\nThis 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.  \r\n\r\n### Steps to reproduce\r\n\r\nSend a push to a channel observed by multiple Installation objects.  \r\n\r\n#### Expected Results\r\n\r\nThe push gets sent to all users. \r\n\r\n#### Actual Outcome\r\n\r\nThe push notification does not get sent.\r\n\r\n### Environment Setup\r\n\r\n- **Server**\r\n  - parse-server version : 2.6.3\r\n  - Operating System:     N/A\r\n  - Hardware:             N/A\r\n  - Localhost or remote server? : Heroku (1 Web Dyno: 2x, 1 Worker Dyno: 2x)\r\n\r\n- **Database**\r\n  - MongoDB version: 3.2.10\r\n  - Storage engine:    - Hardware:        \r\n  - Localhost or remote server?: mLab, Shared cluster 1GB\r\n\r\n### Logs/Trace\r\n\r\n```\r\n verbose: REQUEST for [POST] /parse/push: {\r\n   \"where\": {\r\n     \"channels\": \"CHPIncident-WestLA\"\r\n   },\r\n  \"data\": {\r\n     \"alert\": {\r\n       \"title\": \"CHP Incident West LA\",\r\n       \"body\": \"West LA: traffic Collision-unknown injury  at I405 N   National Blvd\"\r\n     },\r\n     \"chpIncident\": {\r\n       \"centerId\": \"LAHB\",\r\n       \"dispatchId\": \"LACC\",\r\n       \"logId\": \"171008LA01569\",\r\n       \"logTime\": \"Oct  8 2017 10:58AM\",\r\n       \"incidentId\": \"171008LA01569Oct  8 2017 10:58AM\",\r\n       \"logType\": \"1183-Trfc Collision-Unkn Inj\",\r\n       \"location\": \"I405 N / National Blvd\",\r\n       \"drivingText\": \" traffic Collision-unknown injury at i 4 o 5 north   National boulevard \",\r\n       \"drivingTextSoCal\": \" traffic Collision-unknown injury at the 4 o 5 north   National boulevard \",\r\n       \"locationDesc\": \"NB 405 JSO NATIONAL\",\r\n       \"area\": \"West LA\",\r\n       \"broadcastMessage\": \"West LA: traffic Collision-unknown injury  at I405 N   National Blvd\",\r\n       \"lat\": 34.02685,\r\n       \"lon\": -118.429908,\r\n       \"logDetails\": [\r\n         {\r\n           \"time\": \"Oct  8 2017 11:00AM\",\r\n           \"details\": \"[2] POSS DUPE LG/1556 -- RP STATED DESC OF VEHS ON LG/1556 WAS DIFFERENT FRM HER TC\"\r\n         },\r\n         {\r\n           \"time\": \"Oct  8 2017 10:59AM\",\r\n           \"details\": \"[1] BLK NISS ALT, BLK Q5, UNK DESC 3RD VEH\"\r\n         }\r\n       ],\r\n       \"logUnits\": []\r\n     },\r\n     \"expiration_time\": \"2017-10-08T22:02:15.039Z\",\r\n     \"sound\": \"chp_incident.caf\",\r\n     \"PushType\": \"CHPIncident\"\r\n   }\r\n\r\n2017-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\r\n\r\n\r\nRESPONSE from [POST] /parse/push: {\r\n   \"headers\": {\r\n     \"X-Parse-Push-Status-Id\": \"wtqQ4H2N5p\"\r\n   },\r\n   \"response\": {\r\n     \"result\": true\r\n   }\r\n } X-Parse-Push-Status-Id=wtqQ4H2N5p, result=true\r\n verbose: _PushStatus wtqQ4H2N5p: sending push to 267 installations\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/parse-community/parse-server/issues/comments/335039049","html_url":"https://github.com/parse-community/parse-server/issues/4242#issuecomment-335039049","issue_url":"https://api.github.com/repos/parse-community/parse-server/issues/4242","id":335039049,"user":{"login":"flovilmart","id":364568,"avatar_url":"https://avatars3.githubusercontent.com/u/364568?v=4","gravatar_id":"","url":"https://api.github.com/users/flovilmart","html_url":"https://github.com/flovilmart","followers_url":"https://api.github.com/users/flovilmart/followers","following_url":"https://api.github.com/users/flovilmart/following{/other_user}","gists_url":"https://api.github.com/users/flovilmart/gists{/gist_id}","starred_url":"https://api.github.com/users/flovilmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flovilmart/subscriptions","organizations_url":"https://api.github.com/users/flovilmart/orgs","repos_url":"https://api.github.com/users/flovilmart/repos","events_url":"https://api.github.com/users/flovilmart/events{/privacy}","received_events_url":"https://api.github.com/users/flovilmart/received_events","type":"User","site_admin":false},"created_at":"2017-10-08T21:14:24Z","updated_at":"2017-10-08T21:14:24Z","author_association":"OWNER","body":"Just to rewind a bit, sending a simple payload to a channels target works correctly?"}}
{"actor":{"display_login":"flovilmart"}}