Fix backup/import issue with expiring messages.

There was an issue where we were backing up group receipts and attachments
that were for expiring messages (which are already excluded from the backup).

This commit excludes these items from the backup, and for backups made
before this change, this commit also deletes these invalid entries at
the end of the restore process.

We also do a little database migration to cleanup any bad state that may
have been imported in the past.
This commit is contained in:
Greyson Parrelli
2018-06-21 16:48:46 -07:00
parent 61b2da9c8a
commit 71a34dac5f
7 changed files with 82 additions and 6 deletions

View File

@@ -82,6 +82,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
public static final int REMOVE_JOURNAL = 353;
public static final int REMOVE_CACHE = 354;
public static final int FULL_TEXT_SEARCH = 358;
public static final int BAD_IMPORT_CLEANUP = 373;
private static final SortedSet<Integer> UPGRADE_VERSIONS = new TreeSet<Integer>() {{
add(NO_MORE_KEY_EXCHANGE_PREFIX_VERSION);
@@ -103,6 +104,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
add(SQLCIPHER_COMPLETE);
add(REMOVE_CACHE);
add(FULL_TEXT_SEARCH);
add(BAD_IMPORT_CLEANUP);
}};
private MasterSecret masterSecret;