According to the following lines at the end of client.rb's push method:
if error
command, status, index = error.unpack("ccN")
notifications.slice!(0..index)
notifications.each(&:mark_as_unsent!)
push(*notifications)
end
it seems that the push method is called recursively until no error is returned from the APN server. Am I correct in this?
If so, isn't this a terrible idea? The APNs may respond with something as simple as "invalid token". Shouldn't there at least be a maximum retry amount?
Sorry, I was wrong. The call to notifications.slice!(0..index) will remove the notification that failed from the remaining array. That failing notification is ignored.
According to the following lines at the end of
client.rb
'spush
method:it seems that the push method is called recursively until no error is returned from the APN server. Am I correct in this?
If so, isn't this a terrible idea? The APNs may respond with something as simple as "invalid token". Shouldn't there at least be a maximum retry amount?