nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

Are notifications retried indefinitely and without delay? #70

Closed yjukaku closed 10 years ago

yjukaku commented 10 years ago

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?

yjukaku commented 10 years ago

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.