From 1c12a9a258802e84d50aced844d90f6fa7a1482a Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Mon, 10 Aug 2026 16:33:31 -0400 Subject: [PATCH] Use getAccountIdentifier in RemoveExpiredAccountsCommand --- .../textsecuregcm/workers/RemoveExpiredAccountsCommand.java | 5 ++--- .../workers/RemoveExpiredAccountsCommandTest.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommand.java b/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommand.java index 919ee0d79..7cd58386b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommand.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommand.java @@ -16,11 +16,10 @@ import java.time.Instant; import net.sourceforge.argparse4j.inf.Subparser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.whispersystems.textsecuregcm.identity.IdentityType; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; -import reactor.core.publisher.Mono; import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; import reactor.util.retry.Retry; @@ -68,7 +67,7 @@ public class RemoveExpiredAccountsCommand extends AbstractSinglePassCrawlAccount .flatMap(expiredAccount -> { final Mono deleteAccountMono = isDryRun ? Mono.empty() - : Mono.fromRunnable(() -> getCommandDependencies().accountsManager().delete(expiredAccount.getIdentifier(IdentityType.ACI), AccountsManager.DeletionReason.EXPIRED)) + : Mono.fromRunnable(() -> getCommandDependencies().accountsManager().delete(expiredAccount.getAccountIdentifier(), AccountsManager.DeletionReason.EXPIRED)) .subscribeOn(Schedulers.boundedElastic()) .then(); diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommandTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommandTest.java index d7b893c07..0a336e324 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommandTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/workers/RemoveExpiredAccountsCommandTest.java @@ -23,7 +23,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; -import org.whispersystems.textsecuregcm.identity.IdentityType; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; import reactor.core.publisher.Flux; @@ -70,11 +69,11 @@ class RemoveExpiredAccountsCommandTest { final UUID expiredAccountIdentifier = UUID.randomUUID(); final Account activeAccount = mock(Account.class); - when(activeAccount.getIdentifier(IdentityType.ACI)).thenReturn(activeAccountIdentifier); + when(activeAccount.getAccountIdentifier()).thenReturn(activeAccountIdentifier); when(activeAccount.getLastSeen()).thenReturn(clock.instant().toEpochMilli()); final Account expiredAccount = mock(Account.class); - when(expiredAccount.getIdentifier(IdentityType.ACI)).thenReturn(expiredAccountIdentifier); + when(expiredAccount.getAccountIdentifier()).thenReturn(expiredAccountIdentifier); when(expiredAccount.getLastSeen()) .thenReturn(clock.instant().minus(RemoveExpiredAccountsCommand.MAX_IDLE_DURATION).minusMillis(1).toEpochMilli());