Closed sisoje closed 6 years ago
Here is my code:
client.send(notifications) .then(() => { context.log('notifications done', notifications.length) context.done() }) .catch(err => { context.log('notifications done', notifications.length) context.log('error', err) context.done() })
When executing nothing happens - no success no error
will i have trouble if i put MAX_CONNECTIONS to 1000?
Definitely don't increase MAX_CONNECTIONS
to 1000, I'm looking into this and will report back
ok thanks
I found the issue, pushing a new version now
Fixed in v4.0.4: https://github.com/AndrewBarba/apns2/releases/tag/4.0.4
Hello, I'm a contributor to https://github.com/HENNGE/aapns and I wonder how this project solved this particular issue.
IIRC, when the connection is created, the client has to assume "max connections", typically 100
, while the server is going to lower this to 1
very quickly afterwards. It does so because when authentication is done by a token, there's no authentication until the first request. After first request passes authentication check, the server will re-instate reasonable "max connections".
I solved this by artificially restricting connection concurrency until one response indicates OK.
I'm curious what approach this library takes.
I have an array of notifications and it fails to send them if there is more than MAX_CONNECTIONS in array.