Skip to content
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

Lots of 500s #12

Open
mipstian opened this issue Dec 3, 2018 · 2 comments
Open

Lots of 500s #12

mipstian opened this issue Dec 3, 2018 · 2 comments

Comments

@mipstian
Copy link

mipstian commented Dec 3, 2018

I'm using this library to send notifications in batches. I'm creating a single NotificationPusher instance and then using it to send many batches of 100 devices each (please let me know if this is not how the library is meant to be used). Note that I'm doing batching because I don't want my server to be swamped by the app's reaction to the notification, not because of APNS.

Some batches work fine, returning 100 responses that are either "ok" or "inactive device".

Most batches reply with a single 500 error response, with no body. Judging by the code this happens when the response count doesn't match the token count inside of the pusher: https://github.com/PerfectlySoft/Perfect-Notifications/blob/master/Sources/PerfectNotifications/NotificationPusher.swift#L531. Sounds like this is being handled like an internal consistency "this should never happen" error, but it happens a lot :)

What can I do about that? Because this single 500 replaces all responses, I'm not getting the "inactive device" responses. If I keep sending notifications to those tokens, I risk angering APNS. Please help :)

@mipstian
Copy link
Author

mipstian commented Jan 3, 2019

Is this project being maintained?

@mipstian
Copy link
Author

mipstian commented Jan 4, 2019

Update: it seems this issue is triggered by calling pushAPNS() again before the first invocation's callback fires. If doing this is illegal, it should be documented :)

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

1 participant