In my app, I use anonymous authentication to let user access public static data without having to create an account. I have set up a trigger to regularly delete anonymous users to cleanup the database. The anonymous users can also be deleted after 90 days, according to the doc.
The problem is that, after deleting an anonymous user account, when the user opens the app again, the following error occurs:
We have the same issue after we deleted a user in the App Users tab. If user have an Android device he can’t do anything the app always tries to use the same user ID and fails to connect. We tried all possible kind of data cleanup we can find and nothing seems to work.
Hi Ian, thanks for your reply. We have an issue with Android devices. On iOS, after we reinstall the app new user ID is issued and a user can log in but on Android, the same ID is issued and a user can’t log in. Not sure how having an error handler could help are there any actions that can be performed during such kinds of errors on Android?
Connection[1]: Connect timeout
CLIENT_CONNECT_TIMEOUT(realm::sync::Client::Error:121): Sync connection was not fully established in time
Connection[1]: Resolving ‘ws.us-east-1.aws.realm.mongodb.com:443’
Note: this issue is also tracked in this topic. I started the other topic for another reason, but it came down to the same problem.
To answer the questions:
@Sumedha_Mehta1 the user is not null, that is the problem. It is not null, but it is in an invalid state, and it can’t do anything without getting an invalidSession error. Sure, we could log in another user, but this particular user wouldn’t be deleted, neither would be the associated data, so it doesn’t look like a clean solution.
@Ian_Ward detecting the error is not a problem, a call to any Realm function will return an invalidSession so we know there is an error. The problem is, what to do after getting the error, and how to remove the user properly.