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

TooManyProviderTokenUpdates #50

Closed
andrewvmail opened this issue Apr 30, 2021 · 2 comments
Closed

TooManyProviderTokenUpdates #50

andrewvmail opened this issue Apr 30, 2021 · 2 comments

Comments

@andrewvmail
Copy link

Hello!

Can we get closing/reopening connection when we see TooManyProviderTokenUpdates. I'm using mongoosepush.

I believe it's related to this issue that's happening here
jchambers/pushy#811

Currently my fix is to watch the log from outside and restart the process using swatchdog.

I attempted to patch this lib but i don't know enough and it ended up giving me some endless loop...

https://gist.github.com/andrewvmail/d442b7239611a55afd60f4e71166ab2f

Cheers!

@pawlooss1
Copy link
Member

That's really strange. The library is supposed to hold a single authentication token and refresh it every 50 minutes. The Apple documentation states that the token should be refreshed between 20 and 60 minutes.
The only reason that comes to my mind right now is that the TokenBearer process died before the 20 minutes time while the connection process is alive. Then the connection process would use a new token (after the TokenBearer is restarted) on the same connection which would trigger the TooManyProviderTokenUpdates response. Could you look into logs for messages like Shutting down TokenBearer? Also, it would be helpful to turn the debug logs because then the library logs every token refresh with Updating APNS token message.
Nevertheless, I don't think that closing/reopening the connection would be the proper way to handle such issue. It'd be only a workaround. We should seek the root cause of this problem and fix it.

@pawlooss1
Copy link
Member

Closing issue. If the problem is still there feel free to reopen.

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

2 participants