We are designing an offline-first application based on realm-sync. When users encounter a session exception, the app redirects the users to a splash screen notifying them that such an error occurred (“Sync failure. Something went wrong while synchronizing the database.”) The exception handling is based on the earlier topic. The problem is that there is a specific session exception “End of Input” which arbitrary emits when the app is minimized or it’s opened but we haven’t used it for a long time (30 min and more). When the user does some pending changes the database is synched and the exception resolves. The exception “End of Input” doesn’t tell me anything and I am not able to figure out the reason for that exception even when I look through its stack trace. I guess that the realm sync is terminated from time to time when the app does not respond for a while and that exception emits. There is a way to artificially simulate that “End of Input” issue when we pause the sync while the app is running.
So the questions are following.
What does “End of Input” mean?
Should I ignore this session exception and if no how to get rid of periodical exceptions?
Is the realm access tokens expire after 30 minutes - if the app is in use then these will automatically refresh. Additionally, once your app “wakes up” it might try to send the old access token, which will be denied, but then will automatically re-authenticate and get a new one. I imagine this is what is happening in your case but the system should recover automatically.
We have a token validation mechanism, so we refresh the token if it’s necessary. I guess the reason is a bit different. As I mentioned above the issue emits an arbitrary time. I mean after 30 mins the app can or can not throws an exception. That case was just one of the scenarios when this happened. Sometimes the exception throws when the app is active too. The only thing which I have noticed is that the app receives that kind of exception when the sync pauses either explicitly or implicitly.