-
Notifications
You must be signed in to change notification settings - Fork 170
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
Don't keep checking whether the access token that was just fetched is already expired #4941
Comments
Rather than use the expires_at field as it is, we should probably calculate expiration date from the difference between expires_at and issued_at and add that to the local device time. |
That doesn't sound right unless |
|
Fixed by #4943. |
➤ Josman Pérez Expósito commented: Hello Team, do we have an ETA of when this is going to be fixed? I have seen that the pull request has been accepted and it seems to be pending the merge request. I just want to inform the customer of a potential date. Thanks |
We don't have a timeline yet. We're working on it, but even when it is fixed, it needs to be included in an SDK release. It doesn't seem like an overly urgent issue though, so we won't due out-of-band releases specifically for it. Feel free to tell the customer to watch this issue for updates. |
➤ Josman Pérez Expósito commented: Great, thanks for the info [~nikola.irinchev] |
Previously we would check if the access token we just got is still valid using the local clock, and would stay in WaitingForAccessToken if we think it is expired. Instead, assume that the just-acquired token is valid and go strait to Active if we are in WaitingForAccessToken. Fixes #4941.
Previously we would check if the access token we just got is still valid using the local clock, and would stay in WaitingForAccessToken if we think it is expired. Instead, assume that the just-acquired token is valid and go strait to Active if we are in WaitingForAccessToken. Fixes #4941.
realm/realm-js#3985
Likely what’s happening is that if the device time is more than 30 min in the future, it thinks its access token is expired, so it requests a new one. But that one will also (immediately) appear to be expired too, so it tries again, etc. in an infinite loop.
To mitigate this, the client could check if the newly minted access token is already expired. If it is, then likely there's an unrecoverable issue.
The text was updated successfully, but these errors were encountered: