element-hq / riot-android

A glossy Matrix collaboration client for Android
Apache License 2.0
1.4k stars 394 forks source link

Crash on Realm crypto DB #3373

Closed bmarty closed 5 years ago

bmarty commented 5 years ago

Reported by a user:

Fatal Exception: io.realm.exceptions.RealmPrimaryKeyConstraintException: Primary key value already exists: @[USER_ID_REDACTED_MANUALLY].
(/Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsObject.cpp:237)
       at io.realm.internal.OsObject.nativeCreateNewObjectWithStringPrimaryKey(OsObject.java)
       at io.realm.internal.OsObject.createWithPrimaryKey + 202(OsObject.java:202)
       at io.realm.Realm.createObjectInternal + 1049(Realm.java:1049)
       at io.realm.Realm.createObject + 1024(Realm.java:1024)
       at org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore$open$1$1.execute + 127(RealmCryptoStore.kt:127)
       at io.realm.Realm.executeTransaction + 1493(Realm.java:1493)
       at org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore$open$1.invoke + 121(RealmCryptoStore.kt:121)
       at org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore$open$1.invoke + 44(RealmCryptoStore.kt:44)
       at org.matrix.androidsdk.data.cryptostore.db.HelperKt.doWithRealm + 54(Helper.kt:54)
       at org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore.open + 103(RealmCryptoStore.kt:103)
       at org.matrix.androidsdk.MXSession.checkCrypto + 2358(MXSession.java:2358)
       at org.matrix.androidsdk.MXSession$1.postProcess + 294(MXSession.java:294)
       at org.matrix.androidsdk.data.store.MXMemoryStore.dispatchPostProcess + 1482(MXMemoryStore.java:1482)
       at org.matrix.androidsdk.data.store.MXFileStore$2$1.run + 594(MXFileStore.java:594)
       at android.os.Handler.handleCallback + 739(Handler.java:739)
       at android.os.Handler.dispatchMessage + 95(Handler.java:95)
       at android.os.Looper.loop + 145(Looper.java:145)