I’m experiencing the following crash when using app.login:
io.realm.exceptions.RealmError:
at io.realm.internal.objectstore.OsApp.nativeLogin (Native Method)
at io.realm.internal.objectstore.OsApp.access$100 (OsApp.java)
at io.realm.internal.objectstore.OsApp$1.execute (OsApp.java)
at io.realm.internal.network.NetworkRequest.resultOrThrow (Unknown Source:10)
at io.realm.internal.objectstore.OsApp.login (OsApp.java)
at io.realm.mongodb.App.login (App.java)
at com.nekologic.anso.data.realm.proxies.MongoProxy$signIn$2.invokeSuspend (MongoProxy.java:18)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java:86)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.java)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.java)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.java)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.java)
The MongoProxy.signin method looks like this:
private suspend fun signIn(credentials: Credentials):io.realm.mongodb.User?{
return withContext(Dispatchers.IO){
try {
Log.d("SIGN IN", "Start Mongo sign in")
return@withContext app.login(credentials)
} catch (e: AppException) {
Log.d(TAG, e.errorMessage ?: "UnknownError")
return@withContext null
}
}
}
I’m a little confused as to why this wouldn’t catch any errors thrown by app.login, and then of course, why the error is thrown at all. I haven’t been able to replicate this, but this has happened over 300 times since I updated my app using Realm Sync last week. Any pointers would be very appreciated!
Thanks,
Ada