From 287da6e7e395517adae24ce695805048f4413340 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Mon, 5 May 2025 13:35:39 -0400 Subject: [PATCH] Ignore already-locked accounts in PNI key cleanup operations --- .../workers/LockAccountsWithoutPniIdentityKeysCommand.java | 1 + .../workers/RemoveLinkedDevicesWithoutPniKeysCommand.java | 1 + 2 files changed, 2 insertions(+) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/workers/LockAccountsWithoutPniIdentityKeysCommand.java b/service/src/main/java/org/whispersystems/textsecuregcm/workers/LockAccountsWithoutPniIdentityKeysCommand.java index cdef2f356..9a4ed6e27 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/workers/LockAccountsWithoutPniIdentityKeysCommand.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/workers/LockAccountsWithoutPniIdentityKeysCommand.java @@ -73,6 +73,7 @@ public class LockAccountsWithoutPniIdentityKeysCommand extends AbstractSinglePas final AccountsManager accountsManager = getCommandDependencies().accountsManager(); accounts + .filter(account -> !account.hasLockedCredentials()) .filter(account -> account.getIdentityKey(IdentityType.PNI) == null) .flatMap(accountWithoutPniIdentityKey -> { final String platform = DevicePlatformUtil.getDevicePlatform(accountWithoutPniIdentityKey.getPrimaryDevice()) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveLinkedDevicesWithoutPniKeysCommand.java b/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveLinkedDevicesWithoutPniKeysCommand.java index ce1e89bc4..a43ebc1d1 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveLinkedDevicesWithoutPniKeysCommand.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveLinkedDevicesWithoutPniKeysCommand.java @@ -77,6 +77,7 @@ public class RemoveLinkedDevicesWithoutPniKeysCommand extends AbstractSinglePass final KeysManager keysManager = getCommandDependencies().keysManager(); accounts + .filter(account -> !account.hasLockedCredentials()) .filter(account -> account.getDevices().size() > 1) .flatMap(account -> Flux.fromIterable(account.getDevices()) .filter(device -> !device.isPrimary())