Open kraenhansen opened 3 years ago
Do you know what version this was reported on? We should have implemented the first solution that you mention above, in the object store layer since core 10.6.1. However, if it is not working in recent versions, then I'd like to investigate why, perhaps something is going wrong with how we are getting the current time in a browser environment.
@ironage judging by the issue title, this is happening in realm-web which is a js-only implementation that doesn't use Core/OS. It offers the remote mongo API, auth, functions, and so on, but obviously no persistence.
@nirinchev good call, looks like you're correct about that. Glad that something isn't broken with the fix in object-store 😄
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:
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.