mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Delete storage id of unregistered recipients after remote update
This commit is contained in:
parent
ac145e6a27
commit
c05b47e4d0
2 changed files with 13 additions and 12 deletions
|
@ -198,17 +198,6 @@ public class StorageHelper {
|
|||
|
||||
logger.debug("Pre-Merge ID Difference :: {}", idDifference);
|
||||
|
||||
if (!idDifference.localOnlyIds().isEmpty()) {
|
||||
final var updated = account.getRecipientStore()
|
||||
.removeStorageIdsFromLocalOnlyUnregisteredRecipients(connection, idDifference.localOnlyIds());
|
||||
|
||||
if (updated > 0) {
|
||||
logger.warn(
|
||||
"Found {} records that were deleted remotely but only marked unregistered locally. Removed those from local store.",
|
||||
updated);
|
||||
}
|
||||
}
|
||||
|
||||
if (!idDifference.isEmpty()) {
|
||||
final var remoteOnlyRecords = getSignalStorageRecords(storageKey,
|
||||
remoteManifest,
|
||||
|
@ -227,6 +216,18 @@ public class StorageHelper {
|
|||
.filter(id -> !KNOWN_TYPES.contains(id.getType()))
|
||||
.toList();
|
||||
|
||||
if (!idDifference.localOnlyIds().isEmpty()) {
|
||||
final var updated = account.getRecipientStore()
|
||||
.removeStorageIdsFromLocalOnlyUnregisteredRecipients(connection,
|
||||
idDifference.localOnlyIds());
|
||||
|
||||
if (updated > 0) {
|
||||
logger.warn(
|
||||
"Found {} records that were deleted remotely but only marked unregistered locally. Removed those from local store.",
|
||||
updated);
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("Storage ids with unknown type: {} inserts, {} deletes",
|
||||
unknownInserts.size(),
|
||||
unknownDeletes.size());
|
||||
|
|
|
@ -934,7 +934,7 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
|||
}
|
||||
|
||||
public void markUndiscoverablePossiblyUnregistered(final Set<String> numbers) {
|
||||
logger.debug("Marking {} numbers as unregistered", numbers.size());
|
||||
logger.debug("Marking {} numbers as undiscoverable", numbers.size());
|
||||
try (final var connection = database.getConnection()) {
|
||||
connection.setAutoCommit(false);
|
||||
for (final var number : numbers) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue