Ignore already-locked accounts in PNI key cleanup operations

This commit is contained in:
Jon Chambers 2025-05-05 13:35:39 -04:00 committed by Jon Chambers
parent 7cf89764e7
commit 287da6e7e3
2 changed files with 2 additions and 0 deletions

View File

@ -73,6 +73,7 @@ public class LockAccountsWithoutPniIdentityKeysCommand extends AbstractSinglePas
final AccountsManager accountsManager = getCommandDependencies().accountsManager(); final AccountsManager accountsManager = getCommandDependencies().accountsManager();
accounts accounts
.filter(account -> !account.hasLockedCredentials())
.filter(account -> account.getIdentityKey(IdentityType.PNI) == null) .filter(account -> account.getIdentityKey(IdentityType.PNI) == null)
.flatMap(accountWithoutPniIdentityKey -> { .flatMap(accountWithoutPniIdentityKey -> {
final String platform = DevicePlatformUtil.getDevicePlatform(accountWithoutPniIdentityKey.getPrimaryDevice()) final String platform = DevicePlatformUtil.getDevicePlatform(accountWithoutPniIdentityKey.getPrimaryDevice())

View File

@ -77,6 +77,7 @@ public class RemoveLinkedDevicesWithoutPniKeysCommand extends AbstractSinglePass
final KeysManager keysManager = getCommandDependencies().keysManager(); final KeysManager keysManager = getCommandDependencies().keysManager();
accounts accounts
.filter(account -> !account.hasLockedCredentials())
.filter(account -> account.getDevices().size() > 1) .filter(account -> account.getDevices().size() > 1)
.flatMap(account -> Flux.fromIterable(account.getDevices()) .flatMap(account -> Flux.fromIterable(account.getDevices())
.filter(device -> !device.isPrimary()) .filter(device -> !device.isPrimary())