Commit ed8cc6f 1 parent 9ef015c commit ed8cc6f Copy full SHA for ed8cc6f
File tree 1 file changed +10
-0
lines changed
app/src/main/java/com/infomaniak/mail/data/cache
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,19 @@ val MAILBOX_INFO_MIGRATION = AutomaticSchemaMigration { migrationContext ->
34
34
val MAILBOX_CONTENT_MIGRATION = AutomaticSchemaMigration { migrationContext ->
35
35
SentryDebug .addMigrationBreadcrumb(migrationContext)
36
36
migrationContext.deleteRealmAt1stMigration()
37
+ migrationContext.resetFoldersCursor()
37
38
}
38
39
39
40
// Migrate to version #1
40
41
private fun MigrationContext.deleteRealmAt1stMigration () {
41
42
if (oldRealm.schemaVersion() < 1L ) newRealm.deleteAll()
42
43
}
44
+
45
+ // Migrate to version #17
46
+ private fun MigrationContext.resetFoldersCursor () {
47
+ if (oldRealm.schemaVersion() < 17L && newRealm.schemaVersion() >= 17L ) {
48
+ oldRealm.query(className = " Folder" ).find().forEach {
49
+ newRealm.findLatest(it)?.set(propertyName = " cursor" , value = null )
50
+ }
51
+ }
52
+ }
You can’t perform that action at this time.
0 commit comments