Fix attachment dedupe race where original may be deleted before new usage is recorded.

This commit is contained in:
Cody Henthorne
2023-07-11 15:39:30 -04:00
committed by Clark Chen
parent bfcd57881e
commit ec373b5b4d
2 changed files with 98 additions and 85 deletions

View File

@@ -133,9 +133,10 @@ public class ApplicationMigrations {
static final int DEDUPE_DB_MIGRATION_2 = 89;
static final int EMOJI_VERSION_8 = 90;
static final int SVR2_MIRROR = 91;
static final int ATTACHMENT_CLEANUP_3 = 92;
}
public static final int CURRENT_VERSION = 91;
public static final int CURRENT_VERSION = 92;
/**
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
@@ -601,6 +602,10 @@ public class ApplicationMigrations {
jobs.put(Version.SVR2_MIRROR, new Svr2MirrorMigrationJob());
}
if (lastSeenVersion < Version.ATTACHMENT_CLEANUP_3) {
jobs.put(Version.ATTACHMENT_CLEANUP_3, new AttachmentCleanupMigrationJob());
}
return jobs;
}