diff --git a/CHANGES.md b/CHANGES.md index 81059232a50..17d3fed2a63 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,17 @@ +Changes in Element v1.4.25 (2022-06-27) +======================================= + +Bugfixes 🐛 +---------- +- Second attempt to fix session database migration to version 30. + +Changes in Element v1.4.24 (2022-06-22) +======================================= + +Bugfixes 🐛 +---------- +- First attempt to fix session database migration to version 30. + Changes in Element v1.4.23 (2022-06-21) ======================================= diff --git a/fastlane/metadata/android/en-US/changelogs/40104250.txt b/fastlane/metadata/android/en-US/changelogs/40104250.txt new file mode 100644 index 00000000000..61db61727ab --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40104250.txt @@ -0,0 +1,2 @@ +Main changes in this version: Various bug fixes and stability improvements. +Full changelog: https://github.com/vector-im/element-android/releases diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 034b549d857..ebf7ce2a0a3 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -56,7 +56,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.4.24\"" + buildConfigField "String", "SDK_VERSION", "\"1.4.25\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\"" diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo030.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo030.kt index f9c4a8b6422..b9c611f5dde 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo030.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo030.kt @@ -20,8 +20,8 @@ import io.realm.DynamicRealm import org.matrix.android.sdk.internal.database.model.ChunkEntityFields import org.matrix.android.sdk.internal.database.model.EventEntityFields import org.matrix.android.sdk.internal.database.model.TimelineEventEntityFields -import org.matrix.android.sdk.internal.extensions.clearWith import org.matrix.android.sdk.internal.util.database.RealmMigrator +import timber.log.Timber /** * Migrating to: @@ -35,16 +35,23 @@ internal class MigrateSessionTo030(realm: DynamicRealm) : RealmMigrator(realm, 3 .equalTo(ChunkEntityFields.IS_LAST_FORWARD, false) .findAll() + val nbOfDeletedChunks = chunks.size + var nbOfDeletedTimelineEvents = 0 + var nbOfDeletedEvents = 0 chunks.forEach { chunk -> - chunk.getList(ChunkEntityFields.TIMELINE_EVENTS.`$`).clearWith { timelineEvent -> + val timelineEvents = chunk.getList(ChunkEntityFields.TIMELINE_EVENTS.`$`) + timelineEvents.forEach { timelineEvent -> // Don't delete state events val event = timelineEvent.getObject(TimelineEventEntityFields.ROOT.`$`) if (event?.isNull(EventEntityFields.STATE_KEY) == true) { + nbOfDeletedEvents++ event.deleteFromRealm() - timelineEvent.deleteFromRealm() } } - chunk.deleteFromRealm() + nbOfDeletedTimelineEvents += timelineEvents.size + timelineEvents.deleteAllFromRealm() } + chunks.deleteAllFromRealm() + Timber.d("MigrateSessionTo030: $nbOfDeletedChunks deleted chunk(s), $nbOfDeletedTimelineEvents deleted TimelineEvent(s) and $nbOfDeletedEvents deleted Event(s).") } } diff --git a/vector/build.gradle b/vector/build.gradle index ae909bf5138..84f89f21919 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -31,7 +31,7 @@ ext.versionMinor = 4 // Note: even values are reserved for regular release, odd values for hotfix release. // When creating a hotfix, you should decrease the value, since the current value // is the value for the next regular release. -ext.versionPatch = 24 +ext.versionPatch = 25 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct'