mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 10:38:01 +01:00
Retire a now-unused transacational update method for accounts
This commit is contained in:
committed by
Jon Chambers
parent
b048b0bf65
commit
47bfb25f2c
@@ -433,6 +433,7 @@ public class AccountsManager {
|
||||
final Map<Byte, ECSignedPreKey> pniSignedPreKeys,
|
||||
@Nullable final Map<Byte, KEMSignedPreKey> pniPqLastResortPreKeys,
|
||||
final Map<Byte, Integer> pniRegistrationIds) throws MismatchedDevicesException {
|
||||
|
||||
validateDevices(account, pniSignedPreKeys, pniPqLastResortPreKeys, pniRegistrationIds);
|
||||
|
||||
final UUID aci = account.getIdentifier(IdentityType.ACI);
|
||||
@@ -843,22 +844,6 @@ public class AccountsManager {
|
||||
});
|
||||
}
|
||||
|
||||
public CompletionStage<Account> updateDeviceTransactionallyAsync(final Account account,
|
||||
final byte deviceId,
|
||||
final Consumer<Device> deviceUpdater,
|
||||
final Function<Device, Collection<TransactWriteItem>> additionalWriteItemProvider) {
|
||||
|
||||
final UUID uuid = account.getUuid();
|
||||
|
||||
return redisDeleteAsync(account).thenCompose(ignored -> updateTransactionallyWithRetriesAsync(account,
|
||||
a -> a.getDevice(deviceId).ifPresent(deviceUpdater),
|
||||
accounts::updateTransactionallyAsync,
|
||||
() -> accounts.getByAccountIdentifierAsync(uuid).thenApply(Optional::orElseThrow),
|
||||
a -> additionalWriteItemProvider.apply(a.getDevice(deviceId).orElseThrow()),
|
||||
AccountChangeValidator.GENERAL_CHANGE_VALIDATOR,
|
||||
MAX_UPDATE_ATTEMPTS));
|
||||
}
|
||||
|
||||
public Optional<Account> getByE164(final String number) {
|
||||
return getByNumberTimer.timeSupplier(() -> accounts.getByE164(number));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user