I’ve got v3.5 of the push proxy server running with v3.6.2 platform. Works fine after spending some amount of time getting everything right. However, I am seeing sporadic panics in the proxy server:
There does not seem to be an issues tracker for this Github project so I cannot open a ticket with the info. I’ll try and investigate a solution though I’m a Go beginner. Is there a place where I should report this besides here?
Also, is there a way to have a notification sent by default instead of only if @all or @channel are present? We can get around this by programmatically doing this, but if there is something already available that would be great. A quick scan of the notification.go code appears to answer “no” to this.
So, the problem with the panic is that in the code (server.go) there is a check for an error from the apns.Client instance, but then there is a blind check on the result object which may be null:
if err != nil {
LogError(fmt.Sprintf("Failed to send apple push sid=%v did=%v err=%v", msg.ServerId, msg.DeviceId, err))
}
if !res.Sent() {
LogError(fmt.Sprintf("Failed to send apple push with res ApnsID=%v reason=%v code=%v", res.ApnsID, res.Reason, res.StatusCode))
}
This really should be an else if or a check for a null res value (or both). Also, once there is an error I think the apns.Client instance is toast and should be recreated. Not positive on this, but it works for me right now and my proxy is no longer falling over when there is a lull in the notification traffic.