Do most of the proto and database groundwork for the new mediaName.

This commit is contained in:
Greyson Parrelli
2025-06-20 11:47:54 -04:00
committed by Cody Henthorne
parent e705495638
commit 38c8f852bf
431 changed files with 600 additions and 781 deletions

View File

@@ -732,7 +732,7 @@ public class ApplicationMigrations {
}
if (lastSeenVersion < Version.BACKFILL_DIGESTS_V2) {
jobs.put(Version.BACKFILL_DIGESTS_V2, new BackfillDigestsMigrationJob());
// jobs.put(Version.BACKFILL_DIGESTS_V2, new BackfillDigestsMigrationJob());
}
if (lastSeenVersion < Version.CALL_LINK_STORAGE_SYNC) {

View File

@@ -1,41 +0,0 @@
package org.thoughtcrime.securesms.migrations
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.database.SignalDatabase
import org.thoughtcrime.securesms.dependencies.AppDependencies
import org.thoughtcrime.securesms.jobmanager.Job
import org.thoughtcrime.securesms.jobs.BackfillDigestJob
/**
* Finds all attachments that need new digests and schedules a [BackfillDigestJob] for each.
*/
internal class BackfillDigestsMigrationJob(
parameters: Parameters = Parameters.Builder().build()
) : MigrationJob(parameters) {
companion object {
val TAG = Log.tag(BackfillDigestsMigrationJob::class.java)
const val KEY = "BackfillDigestsMigrationJob"
}
override fun getFactoryKey(): String = KEY
override fun isUiBlocking(): Boolean = false
override fun performMigration() {
val jobs = SignalDatabase.attachments.getAttachmentsThatNeedNewDigests()
.map { BackfillDigestJob(it) }
AppDependencies.jobManager.addAll(jobs)
Log.i(TAG, "Enqueued ${jobs.size} backfill digest jobs.")
}
override fun shouldRetry(e: Exception): Boolean = false
class Factory : Job.Factory<BackfillDigestsMigrationJob> {
override fun create(parameters: Parameters, serializedData: ByteArray?): BackfillDigestsMigrationJob {
return BackfillDigestsMigrationJob(parameters)
}
}
}