PerfectlySoft / PerfectlySoft/Perfect-Notifications
Lots of 500s
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 117
- Forks
- 29
- Avg merge
- 16m
- Merged PRs (30d)
- 1
Description
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 :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read Sources/PerfectNotifications/NotificationPusher.swift around line 531 and trace how a 100-device batch becomes a single 500 response when response and token counts differ. Reproduce the batching behavior described in the issue and verify that individual inactive-device responses are retained instead of being replaced by the aggregate error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- backend-api-design, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100