mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Fix issues with StorageSyncV2 bookkeeping.
1. I screwed up the comparators in the record processor. Pretty bad, glad this was caught. 2. Previously I was sort of keeping track of which local-only records were accounted for while I was merging, and then hoping everything worked out in the end. Now I just very directly take some set differences and retrieve the appropriate records, so it's clear that we should never fail certain validations. 3. Rev's the feature flag so we don't turn on something broken.
This commit is contained in:
@@ -2737,7 +2737,7 @@ public class RecipientDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
public void clearDirtyStateForRecords(@NonNull List<SignalStorageRecord> records) {
|
||||
public void clearDirtyStateForStorageIds(@NonNull Collection<StorageId> ids) {
|
||||
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||
|
||||
Preconditions.checkArgument(db.inTransaction(), "Database should already be in a transaction.");
|
||||
@@ -2747,8 +2747,8 @@ public class RecipientDatabase extends Database {
|
||||
|
||||
String query = STORAGE_SERVICE_ID + " = ?";
|
||||
|
||||
for (SignalRecord record : records) {
|
||||
String[] args = SqlUtil.buildArgs(Base64.encodeBytes(record.getId().getRaw()));
|
||||
for (StorageId id : ids) {
|
||||
String[] args = SqlUtil.buildArgs(Base64.encodeBytes(id.getRaw()));
|
||||
db.update(TABLE_NAME, values, query, args);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user