Fix possible de-duping issues.

- Clean bad hashes from earlier release.
- Fix file equality comparison.
- Given our new de-duping, we don't want to run into a situation where two
simultaneous compressions could be happening on the same image.
This commit is contained in:
Greyson Parrelli
2019-10-23 16:16:13 -07:00
parent 23d478191f
commit 4260a8436b
3 changed files with 10 additions and 3 deletions

View File

@@ -87,8 +87,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
private static final int BLUR_HASH = 30;
private static final int MMS_RECIPIENT_CLEANUP_2 = 31;
private static final int ATTACHMENT_TRANSFORM_PROPERTIES = 32;
private static final int ATTACHMENT_CLEAR_HASHES = 33;
private static final int DATABASE_VERSION = 32;
private static final int DATABASE_VERSION = 33;
private static final String DATABASE_NAME = "signal.db";
private final Context context;
@@ -602,6 +603,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
db.execSQL("ALTER TABLE part ADD COLUMN transform_properties TEXT DEFAULT NULL");
}
if (oldVersion < ATTACHMENT_CLEAR_HASHES) {
db.execSQL("UPDATE part SET data_hash = null");
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();