Fix incorrect local group state bug.

This commit is contained in:
Cody Henthorne
2024-06-26 11:30:33 -04:00
committed by Nicholas Tinsley
parent 37815a3f39
commit a66857a7cc
4 changed files with 26 additions and 9 deletions

View File

@@ -94,6 +94,7 @@ import org.thoughtcrime.securesms.database.helpers.migration.V233_FixInAppPaymen
import org.thoughtcrime.securesms.database.helpers.migration.V234_ThumbnailRestoreStateColumn
import org.thoughtcrime.securesms.database.helpers.migration.V235_AttachmentUuidColumn
import org.thoughtcrime.securesms.database.helpers.migration.V236_FixInAppSubscriberCurrencyIfAble
import org.thoughtcrime.securesms.database.helpers.migration.V237_ResetGroupForceUpdateTimestamps
/**
* Contains all of the database migrations for [SignalDatabase]. Broken into a separate file for cleanliness.
@@ -190,10 +191,11 @@ object SignalDatabaseMigrations {
233 to V233_FixInAppPaymentTableDefaultNotifiedValue,
234 to V234_ThumbnailRestoreStateColumn,
235 to V235_AttachmentUuidColumn,
236 to V236_FixInAppSubscriberCurrencyIfAble
236 to V236_FixInAppSubscriberCurrencyIfAble,
237 to V237_ResetGroupForceUpdateTimestamps
)
const val DATABASE_VERSION = 236
const val DATABASE_VERSION = 237
@JvmStatic
fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2024 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.database.helpers.migration
import android.app.Application
import net.zetetic.database.sqlcipher.SQLiteDatabase
/**
* Reset last forced update timestamp for groups to fix a local group state bug.
*/
@Suppress("ClassName")
object V237_ResetGroupForceUpdateTimestamps : SignalDatabaseMigration {
override fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
db.execSQL("UPDATE groups SET last_force_update_timestamp = 0")
}
}