Ignore already-locked accounts in PNI key cleanup operations

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2025-05-05 13:53:22 -04:00
1 parent 7cf89764e7
commit 287da6e7e3
2 files changed
+2

No files matched your search

@@ -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())
@@ -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())