Skip to content

TooManyProviderTokenUpdates issue on v0.14.1 #811

@zsophy111

Description

@zsophy111

This issue is related to this one: #793

We are using Pushy for our APNS push notification in a complex enterprise application.
We originally used Pushy 0.13.10, but we continuously had native memory growth issue, so we upgraded the version to 0.14.1.
v0.14.1 solved the memory issue, however, we have met this TooManyProviderTokenUpdates issue, which we haven’t seen on v0.13.10.

We think this issue comes from this Pushy fix 747: d42f6d7
In this fix, it proactively invalidates APNS auth token (set it to null) every 50 mins by default, which makes the APNS client to retrieve new tokens after invalidation. If one APNS client retrieve new auth token more than once in 20mins from APNS server, it will return this TooManyProviderTokenUpdates error.

In our application, we don’t create an APNS client per thread but our APNS client is shared among threads.
In ApnsClient doc: https://pushy-apns.org/apidocs/0.14/com/eatthepath/pushy/apns/ApnsClient.html
it says “APNs clients are intended to be long-lived, persistent resources. They are also inherently thread-safe and can be shared across many threads in a complex application. “ so I think we’re using it correctly.

So in this Pushy fix 747, perhaps when the timer fires and the token is set to null, more than one thread try and fetch a new token which pushes us over the limit. A fix could potentially be for the timer thread to fetch a new token and overwrite the old one rather than just setting it to null.

We can not rollback to v0.13.10 because of the memory leak issue, or older version because we need the iOS13 features. So we really rely on the new release to fix this TooManyProviderTokenUpdates error. Please let me know if you need more information for the fix. Looking forward to hearing back!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions