Handle multiple values with same ACI in deleted-accounts table
Co-authored-by: Chris Eager <79161849+eager-signal@users.noreply.github.com>
This commit is contained in:
parent
739ed56b4c
commit
0cb6f662c6
|
@ -1217,11 +1217,10 @@ public class Accounts extends AbstractDynamoDbStore {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.count() > 1) {
|
return response.items().stream()
|
||||||
throw new RuntimeException("Impossible result: more than one phone number returned for UUID: " + uuid);
|
.map(item -> item.get(DELETED_ACCOUNTS_KEY_ACCOUNT_E164).s())
|
||||||
}
|
.filter(e164OrPni -> e164OrPni.startsWith("+"))
|
||||||
|
.findFirst();
|
||||||
return Optional.ofNullable(response.items().get(0).get(DELETED_ACCOUNTS_KEY_ACCOUNT_E164).s());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<Void> delete(final UUID uuid, final List<TransactWriteItem> additionalWriteItems) {
|
public CompletableFuture<Void> delete(final UUID uuid, final List<TransactWriteItem> additionalWriteItems) {
|
||||||
|
|
Loading…
Reference in New Issue