From b63f176ad7edba3dc9180ca5d978b8136a4e3c3f Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Mon, 10 Aug 2026 16:33:19 -0400 Subject: [PATCH] Use getAccountIdentifier in device transfer context --- .../textsecuregcm/storage/AccountsManager.java | 6 +++--- .../AccountsManagerDeviceTransferIntegrationTest.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java index b53a8428a..99977a2b9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java @@ -1524,8 +1524,8 @@ public class AccountsManager extends RedisPubSubAdapter implemen } public CompletableFuture> waitForTransferArchive(final Account account, final Device device, final Duration timeout) { - final DeviceIdentifier deviceIdentifier = new DeviceIdentifier(account.getIdentifier(IdentityType.ACI), device.getId(), device.getRegistrationId(IdentityType.ACI)); - final String registrationIdTransferArchiveKey = getRegistrationIdTransferArchiveKey(account.getIdentifier(IdentityType.ACI), device.getId(), device.getRegistrationId(IdentityType.ACI)); + final DeviceIdentifier deviceIdentifier = new DeviceIdentifier(account.getAccountIdentifier(), device.getId(), device.getRegistrationId(IdentityType.ACI)); + final String registrationIdTransferArchiveKey = getRegistrationIdTransferArchiveKey(account.getAccountIdentifier(), device.getId(), device.getRegistrationId(IdentityType.ACI)); return waitForPubSubKey(waitForTransferArchiveFuturesByDeviceIdentifier, deviceIdentifier, @@ -1541,7 +1541,7 @@ public class AccountsManager extends RedisPubSubAdapter implemen try { final String transferArchiveJson = SystemMapper.jsonMapper().writeValueAsString(transferArchiveResult); - final String key = getRegistrationIdTransferArchiveKey(account.getIdentifier(IdentityType.ACI), destinationDeviceId, registrationId); + final String key = getRegistrationIdTransferArchiveKey(account.getAccountIdentifier(), destinationDeviceId, registrationId); return ResilienceUtil.getGeneralRedisRetry(RETRY_NAME) .executeCompletionStage(retryExecutor, () -> pubSubRedisClient.withConnection(connection -> connection.async() diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java index edea12c80..d380356cb 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java @@ -97,7 +97,7 @@ public class AccountsManagerDeviceTransferIntegrationTest { when(device.getRegistrationId(IdentityType.ACI)).thenReturn(registrationId); final Account account = mock(Account.class); - when(account.getIdentifier(IdentityType.ACI)).thenReturn(accountIdentifier); + when(account.getAccountIdentifier()).thenReturn(accountIdentifier); final CompletableFuture> displacedFuture = accountsManager.waitForTransferArchive(account, device, Duration.ofSeconds(5)); @@ -126,7 +126,7 @@ public class AccountsManagerDeviceTransferIntegrationTest { when(device.getRegistrationId(IdentityType.ACI)).thenReturn(registrationId); final Account account = mock(Account.class); - when(account.getIdentifier(IdentityType.ACI)).thenReturn(accountIdentifier); + when(account.getAccountIdentifier()).thenReturn(accountIdentifier); accountsManager.recordTransferArchiveUpload(account, deviceId, registrationId, transferArchive).join(); @@ -148,7 +148,7 @@ public class AccountsManagerDeviceTransferIntegrationTest { when(device.getRegistrationId(IdentityType.ACI)).thenReturn(registrationId); final Account account = mock(Account.class); - when(account.getIdentifier(IdentityType.ACI)).thenReturn(accountIdentifier); + when(account.getAccountIdentifier()).thenReturn(accountIdentifier); accountsManager.recordTransferArchiveUpload(account, deviceId, registrationId, transferArchiveError).join(); @@ -165,7 +165,7 @@ public class AccountsManagerDeviceTransferIntegrationTest { when(device.getRegistrationId(IdentityType.ACI)).thenReturn(123); final Account account = mock(Account.class); - when(account.getIdentifier(IdentityType.ACI)).thenReturn(accountIdentifier); + when(account.getAccountIdentifier()).thenReturn(accountIdentifier); assertEquals(Optional.empty(), accountsManager.waitForTransferArchive(account, device, Duration.ofMillis(1)).join());