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

Token refresh fails silently when offline and never recovers #226

Closed
jake-nz opened this issue Feb 15, 2022 · 2 comments · Fixed by #278
Closed

Token refresh fails silently when offline and never recovers #226

jake-nz opened this issue Feb 15, 2022 · 2 comments · Fixed by #278
Labels
bug Something isn't working p3 Priority 3 released

Comments

@jake-nz
Copy link

jake-nz commented Feb 15, 2022

Bug report

Describe the bug

If the user is offline when their token expires then _callRefreshToken will fail. The failure is not handled well so there's no indication that there was a problem (except that the token no longer works) and there's no attempt to refresh again.

_startAutoRefreshToken uses setTimeout(() => this._callRefreshToken(), value)
_callRefreshToken does not throw errors, it returns them so the get ignored here. The token is not refreshed and a new timeout is not set.

Related: #141

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Log in
  2. Go offline
  3. Wait for token to expire
  4. Go online
  5. Try to use the token

Expected behavior

  • The error should not be silently swallowed
  • There should be another attempt to refresh the token at a later time
@jake-nz jake-nz added the bug Something isn't working label Feb 15, 2022
@chipilov
Copy link

chipilov commented Mar 7, 2022

I think it would be nice if such failures (regardless of whether it's because you are offline or some other error) trigger a new event type (e.g. TOKEN_REFRESH_FAILED).

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2022

🎉 This issue has been resolved in version 1.22.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

@egor-romanov egor-romanov added the p3 Priority 3 label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p3 Priority 3 released
Projects
None yet
3 participants