element-hq / element-hq/element-android

[SDK] Failed to login exception io.realm.exceptions.RealmMigrationNeededException: Migration is required after updating the SDK from 1.5.30 to 1.6.36

Open
#9,040 1 comment 2 reactions 0 assignees View on GitHub
matrix-sdk
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### Description

I am currently updating my SDK from version 1.5.30 to 1.6.36. The fresh installation of the SDK works perfectly; however, when I attempt to update my old app to the new version with the latest SDK, I encounter the following errors:

Failed to login
Exception: io.realm.exceptions.RealmMigrationNeededException
Migration is required due to the following issues:
Property CryptoRoomEntity.rotationPeriodMs has been added.
Property CryptoRoomEntity.rotationPeriodMsgs has been added.

Something wrong happened during previous session creation. Override with new credentials (Ask Gemini)
io.realm.exceptions.RealmPrimaryKeyConstraintException: Value already exists: 6d682390f1469937b946c9b317a73afc
at io.realm.internal.Table.throwDuplicatePrimaryKeyException(Table.java:390)
at io.realm.org_matrix_android_sdk_internal_auth_db_SessionParamsEntityRealmProxy.insert(org_matrix_android_sdk_internal_auth_db_SessionParamsEntityRealmProxy.java:520)
at io.realm.AuthRealmModuleMediator.insert(AuthRealmModuleMediator.java:135)
at io.realm.Realm.insert(Realm.java:1330)
at org.matrix.android.sdk.internal.auth.db.RealmSessionParamsStore$save$2.invoke(RealmSessionParamsStore.kt:72)
at org.matrix.android.sdk.internal.auth.db.RealmSessionParamsStore$save$2.invoke(RealmSessionParamsStore.kt:68)
at org.matrix.android.sdk.internal.database.AsyncTransactionKt$awaitTransaction$2.invokeSuspend(AsyncTransaction.kt:46)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

Is there something specific I need to do when updating the app from an older version to a newer one? I didn't see any way to provide the migration path, as it seems to be entirely controlled by the SDK

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.