Fixes post merge errors
This commit is contained in:
parent
c73c36eb26
commit
7d29fbc68c
|
@ -50,6 +50,7 @@ import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo029
|
||||||
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo030
|
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo030
|
||||||
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo031
|
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo031
|
||||||
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo032
|
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo032
|
||||||
|
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo033
|
||||||
import org.matrix.android.sdk.internal.util.Normalizer
|
import org.matrix.android.sdk.internal.util.Normalizer
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -64,7 +65,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
||||||
override fun equals(other: Any?) = other is RealmSessionStoreMigration
|
override fun equals(other: Any?) = other is RealmSessionStoreMigration
|
||||||
override fun hashCode() = 1000
|
override fun hashCode() = 1000
|
||||||
|
|
||||||
val schemaVersion = 32L
|
val schemaVersion = 33L
|
||||||
|
|
||||||
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
|
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
|
||||||
Timber.d("Migrating Realm Session from $oldVersion to $newVersion")
|
Timber.d("Migrating Realm Session from $oldVersion to $newVersion")
|
||||||
|
@ -101,5 +102,6 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
||||||
if (oldVersion < 30) MigrateSessionTo030(realm).perform()
|
if (oldVersion < 30) MigrateSessionTo030(realm).perform()
|
||||||
if (oldVersion < 31) MigrateSessionTo031(realm).perform()
|
if (oldVersion < 31) MigrateSessionTo031(realm).perform()
|
||||||
if (oldVersion < 32) MigrateSessionTo032(realm).perform()
|
if (oldVersion < 32) MigrateSessionTo032(realm).perform()
|
||||||
|
if (oldVersion < 33) MigrateSessionTo033(realm).perform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.matrix.android.sdk.internal.database.migration
|
||||||
|
|
||||||
|
import io.realm.DynamicRealm
|
||||||
|
import org.matrix.android.sdk.internal.database.model.RoomSummaryEntityFields
|
||||||
|
import org.matrix.android.sdk.internal.util.database.RealmMigrator
|
||||||
|
|
||||||
|
internal class MigrateSessionTo033(realm: DynamicRealm) : RealmMigrator(realm, 33) {
|
||||||
|
|
||||||
|
override fun doMigrate(realm: DynamicRealm) {
|
||||||
|
realm.schema.get("RoomSummaryEntity")
|
||||||
|
?.addRealmListField(RoomSummaryEntityFields.DIRECT_PARENT_NAMES.`$`, String::class.java)
|
||||||
|
?.transform { it.setString(RoomSummaryEntityFields.DIRECT_PARENT_NAMES.`$`, "") }
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,10 +20,10 @@ import org.junit.Test
|
||||||
import org.matrix.android.sdk.internal.database.model.RoomSummaryEntityFields
|
import org.matrix.android.sdk.internal.database.model.RoomSummaryEntityFields
|
||||||
import org.matrix.android.sdk.test.fakes.FakeDynamicRealm
|
import org.matrix.android.sdk.test.fakes.FakeDynamicRealm
|
||||||
|
|
||||||
internal class MigrateSessionTo032Test {
|
internal class MigrateSessionTo033Test {
|
||||||
|
|
||||||
private val fakeDynamicRealm = FakeDynamicRealm()
|
private val fakeDynamicRealm = FakeDynamicRealm()
|
||||||
private val migrator = MigrateSessionTo032(fakeDynamicRealm.instance)
|
private val migrator = MigrateSessionTo033(fakeDynamicRealm.instance)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `when doMigrate, then directParentNames added`() {
|
fun `when doMigrate, then directParentNames added`() {
|
|
@ -331,7 +331,7 @@ class RoomListSectionBuilder(
|
||||||
},
|
},
|
||||||
{ queryParams ->
|
{ queryParams ->
|
||||||
val name = stringProvider.getString(R.string.bottom_action_rooms)
|
val name = stringProvider.getString(R.string.bottom_action_rooms)
|
||||||
val updatableFilterLivePageResult = session.roomService().getFilteredPagedRoomSummariesLive(queryParams, getFlattenParents = true)
|
val updatableFilterLivePageResult = session.roomService().getFilteredPagedRoomSummariesLive(queryParams)
|
||||||
onUpdatable(updatableFilterLivePageResult)
|
onUpdatable(updatableFilterLivePageResult)
|
||||||
|
|
||||||
val itemCountFlow = updatableFilterLivePageResult.livePagedList.asFlow()
|
val itemCountFlow = updatableFilterLivePageResult.livePagedList.asFlow()
|
||||||
|
|
Loading…
Reference in New Issue