Compare commits

...

2 Commits

Author SHA1 Message Date
Greyson Parrelli
410af95f14 Bump version to 7.17.6 2024-09-24 12:43:50 -04:00
Greyson Parrelli
0b7d81bbf6 Fix issue with attachments failing to download. 2024-09-24 12:35:38 -04:00
5 changed files with 38 additions and 4 deletions

View File

@@ -22,8 +22,8 @@ plugins {
apply(from = "static-ips.gradle.kts")
val canonicalVersionCode = 1462
val canonicalVersionName = "7.17.5"
val currentHotfixVersion = 0
val canonicalVersionName = "7.17.6"
val currentHotfixVersion = 1
val maxHotfixVersions = 100
val keystores: Map<String, Properties?> = mapOf("debug" to loadKeystoreProperties("keystore.debug.properties"))

View File

@@ -253,6 +253,15 @@ class AttachmentTableTest_deduping {
assertDoesNotHaveRemoteFields(id2)
assertArchiveFieldsMatch(id1, id2)
upload(id2)
assertDataFilesAreTheSame(id1, id2)
assertDataHashStartMatches(id1, id2)
assertDataHashEndMatches(id1, id2)
assertSkipTransform(id1, true)
assertSkipTransform(id2, true)
assertRemoteFieldsMatch(id1, id2)
}
// This isn't so much "desirable behavior" as it is documenting how things work.
@@ -653,6 +662,7 @@ class AttachmentTableTest_deduping {
}
fun upload(attachmentId: AttachmentId, uploadTimestamp: Long = System.currentTimeMillis()) {
SignalDatabase.attachments.createKeyIvIfNecessary(attachmentId)
SignalDatabase.attachments.finalizeAttachmentAfterUpload(attachmentId, createUploadResult(attachmentId, uploadTimestamp))
val attachment = SignalDatabase.attachments.getAttachment(attachmentId)!!

View File

@@ -1115,6 +1115,8 @@ class AttachmentTable(
TRANSFER_STATE to TRANSFER_PROGRESS_DONE,
CDN_NUMBER to uploadResult.cdnNumber,
REMOTE_LOCATION to uploadResult.remoteId.toString(),
REMOTE_KEY to Base64.encodeWithPadding(uploadResult.key),
REMOTE_IV to uploadResult.iv,
REMOTE_DIGEST to uploadResult.digest,
REMOTE_INCREMENTAL_DIGEST to uploadResult.incrementalDigest,
REMOTE_INCREMENTAL_DIGEST_CHUNK_SIZE to uploadResult.incrementalDigestChunkSize,

View File

@@ -106,6 +106,7 @@ import org.thoughtcrime.securesms.database.helpers.migration.V244_AttachmentRemo
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
import org.thoughtcrime.securesms.database.helpers.migration.V250_ClearUploadTimestampV2
/**
* Contains all of the database migrations for [SignalDatabase]. Broken into a separate file for cleanliness.
@@ -213,10 +214,12 @@ object SignalDatabaseMigrations {
244 to V244_AttachmentRemoteIv,
245 to V245_DeletionTimestampOnCallLinks,
246 to V246_DropThumbnailCdnFromAttachments,
247 to V247_ClearUploadTimestamp
247 to V247_ClearUploadTimestamp,
// 248 and 249 were originally in 7.18.0, but are now skipped because we needed to hotfix 7.17.6 after 7.18.0 was already released.
250 to V250_ClearUploadTimestampV2
)
const val DATABASE_VERSION = 247
const val DATABASE_VERSION = 250
@JvmStatic
fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {

View File

@@ -0,0 +1,19 @@
/*
* 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
/**
* Turns out we need to run [V247_ClearUploadTimestamp] again, because there was another situation where we had mismatching transit data across duplicates.
*/
@Suppress("ClassName")
object V250_ClearUploadTimestampV2 : SignalDatabaseMigration {
override fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
db.execSQL("UPDATE attachment SET upload_timestamp = 1 WHERE upload_timestamp > 0")
}
}