From 320669c54e2c72db7324cba9f382b97b2bf7a1a0 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Wed, 4 Jan 2023 12:25:40 -0500 Subject: [PATCH] Remove the unknown insert validation. There's actually a legitimate case where this is ok: right after a backup restore. Restoring a backup means that you have possibly carried over some unknownIds, and if you don't remember your PIN, those items wouldn't be there remotely. And you _should_ insert them. Otherwise they're lost. I don't think this validation is worth the trouble of carving out lots of conditions to allow this usecase. --- .../securesms/storage/StorageSyncValidations.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncValidations.java b/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncValidations.java index a4a6ffc202..eddd056853 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncValidations.java +++ b/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncValidations.java @@ -137,10 +137,6 @@ public final class StorageSyncValidations { throw new InsertNotPresentInFullIdSetError(); } - if (insert.isUnknown()) { - throw new UnknownInsertError(); - } - if (insert.getContact().isPresent()) { SignalContactRecord contact = insert.getContact().get(); @@ -173,9 +169,6 @@ public final class StorageSyncValidations { private static final class DeletePresentInFullIdSetError extends Error { } - private static final class UnknownInsertError extends Error { - } - private static final class MultipleAccountError extends Error { }