Skip to content

Commit

Permalink
Merge tag 'v7.17.3' into molly-7.17
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed Sep 18, 2024
2 parents 4444392 + 1f638db commit 046794f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ apply {
from("fix-profm.gradle")
}

val canonicalVersionCode = 1459
val canonicalVersionName = "7.17.2"
val canonicalVersionCode = 1460
val canonicalVersionName = "7.17.3"
val currentHotfixVersion = 0
val maxHotfixVersions = 100
val mollyRevision = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CallLinkTable(context: Context, databaseHelper: SignalDatabase) : Database
$REVOKED INTEGER NOT NULL,
$EXPIRATION INTEGER NOT NULL,
$RECIPIENT_ID INTEGER UNIQUE REFERENCES ${RecipientTable.TABLE_NAME} (${RecipientTable.ID}) ON DELETE CASCADE,
$DELETION_TIMESTAMP INTEGER NOT NULL
$DELETION_TIMESTAMP INTEGER DEFAULT 0 NOT NULL
)
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import org.thoughtcrime.securesms.database.helpers.migration.V243_MessageFullTex
import org.thoughtcrime.securesms.database.helpers.migration.V244_AttachmentRemoteIv
import org.thoughtcrime.securesms.database.helpers.migration.V245_DeletionTimestampOnCallLinks
import org.thoughtcrime.securesms.database.helpers.migration.V246_DropThumbnailCdnFromAttachments
import org.thoughtcrime.securesms.database.helpers.migration.V247_ClearUploadTimestamp

/**
* Contains all of the database migrations for [SignalDatabase]. Broken into a separate file for cleanliness.
Expand Down Expand Up @@ -213,10 +214,11 @@ object SignalDatabaseMigrations {
243 to V243_MessageFullTextSearchDisableSecureDelete,
244 to V244_AttachmentRemoteIv,
245 to V245_DeletionTimestampOnCallLinks,
246 to V246_DropThumbnailCdnFromAttachments
246 to V246_DropThumbnailCdnFromAttachments,
247 to V247_ClearUploadTimestamp
)

const val DATABASE_VERSION = 246
const val DATABASE_VERSION = 247

@JvmStatic
fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2023 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

/**
* There was a bad interaction with the digest backfill job, where digests could be changed, and then already-uploaded attachments could be re-used
* but with a no-longer-matching digest. This migration set the upload timestamp to 1 for all uploaded attachments so that we don't re-use them.
*/
@Suppress("ClassName")
object V247_ClearUploadTimestamp : SignalDatabaseMigration {
override fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
db.execSQL("UPDATE attachment SET upload_timestamp = 1 WHERE upload_timestamp > 0")
}
}

0 comments on commit 046794f

Please sign in to comment.