Skip to content

apns never reports numFailed in _PushStatus. #55

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

Closed
jeacott1 opened this issue Feb 8, 2017 · 9 comments
Closed

apns never reports numFailed in _PushStatus. #55

jeacott1 opened this issue Feb 8, 2017 · 9 comments

Comments

@jeacott1
Copy link
Contributor

jeacott1 commented Feb 8, 2017

GCM works fine in this regard, and properly reports success/failures, but apns never updates the tracker on fail.
log:

verbose: sending push to 1 installations
  apn Socket drained 1 +4s
  apn 0 left to send +0ms
verbose: sent push! 1 success, 0 failures
  apn 0 left to send +5ms
  apn Notification 0 caused an error: 5 +275ms
ERR! parse-server-push-adapter APNS cannot find vaild connection for xxxxxxxx
  apn Raising error: 5 { encoding: 'utf8',
  payload: 

corresponding _PushStatus ("numFailed" : 0)

{ "_id" : "V4J5VKGvQf", "pushTime" : "2017-02-08T00:38:25.616Z",
 "query" : "{\"objectId\":\"8BHXqhukp5\"}", 
"payload" : "{\"alert\":\"just a test\"}", 
"source" : "rest", "status" : "succeeded", "numSent" : 1, 
"pushHash" : "cddc3a1fd8d20707a0ff8b839a60737a",
 "_wperm" : [ ], "_rperm" : [ ],
 "_acl" : {  }, "_created_at" : ISODate("2017-02-08T00:38:25.616Z"), 
"_updated_at" : ISODate("2017-02-08T00:38:28.645Z"),
 "numFailed" : 0, "sentPerType" : { "ios" : 1 } }
@flovilmart
Copy link
Contributor

uhm, seems that because APNS support multiple 'connections' we don't track if it's the last try. Also successful push does not mean delivery, hopefully we'll have something with #52 :)

@jeacott1
Copy link
Contributor Author

jeacott1 commented Feb 8, 2017

successful push for gcm means no failure response from gcm. why shouldnt it be the same behaviour for apns?
the apns adapter assumes that if its sent something to the apns service its all good, despite any transmissionError.

@flovilmart
Copy link
Contributor

yeah but APNS behaves differently from GCM, transmission to APNS doesn't mean it's gonna be delivered hence the feedback service.

Not sure how GCM handles it but from what I saw, it seems to be fairly transactional.

In any case, feel free to provide a fix for that issue.

@jeacott1
Copy link
Contributor Author

jeacott1 commented Feb 8, 2017

agreed, but both return failures when they can.
I'll see what I can do. javascript isn't fun.

@flovilmart
Copy link
Contributor

The main difference is that we support multiple connections for APNS not for GCM IIRC. So we have to check for APNS and keep track of transient failures.

@jeacott1
Copy link
Contributor Author

jeacott1 commented Feb 8, 2017

looks like apn v2 should make this easier, no more transmitted firing before transmittionError,
just plain success/fail.

@jeacott1
Copy link
Contributor Author

jeacott1 commented Feb 8, 2017

actually, #52 fixes the issue, and is significantly faster than the existing version while its at it,
so roll it in asap please :)

@flovilmart
Copy link
Contributor

Yes, because APNSv2 is transactional and not fire and forget

@flovilmart
Copy link
Contributor

apns v2 will be parse of parse-server 2.5.1, which is currently being built. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants