-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Problem
Users are experiencing messages in the browsers console as a request fails due to an expired access token.
Even though these errors doesn't inflict any functional pain on developers or their users, we they're a slight inconvenience and we should eventually find a way to get rid of them.
Solution
Two solutions comes to mind:
- Check the expiration of the access token and compare it to the browsers time and ensure to preflight a request to refresh it if it's expired.
- Refresh the access token on a timeout, to ensure it is refreshed ahead of time, before a request is made.
I would suggest we go for option 1, since 2 is not guaranteed to actually refresh before a request (ex. the computer was hibernating as the timeout should fire). Also option 2 would probably cause warnings in React Native (as scheduling a timeout in the far future does).
How important is this improvement for you?
Fairly niche, but nice to have anyway.