Ensure that we have the latest recipient copy after refreshing serviceIds.

Fixes #14163
This commit is contained in:
Greyson Parrelli
2025-06-09 10:08:53 -04:00
parent e2c32c1172
commit c8f389028e

View File

@@ -94,7 +94,7 @@ public class RecipientUtil {
ensureUuidsAreAvailable(context, recipients); ensureUuidsAreAvailable(context, recipients);
return Stream.of(recipients) return Stream.of(recipients)
.map(Recipient::resolve) .map(it -> it.live().resolve())
.map(r -> new SignalServiceAddress(r.requireServiceId(), r.getE164().orElse(null))) .map(r -> new SignalServiceAddress(r.requireServiceId(), r.getE164().orElse(null)))
.toList(); .toList();
} }
@@ -113,7 +113,7 @@ public class RecipientUtil {
if (recipientsWithoutUuids.size() > 0) { if (recipientsWithoutUuids.size() > 0) {
ContactDiscovery.refresh(context, recipientsWithoutUuids, false); ContactDiscovery.refresh(context, recipientsWithoutUuids, false);
if (recipients.stream().map(Recipient::resolve).anyMatch(Recipient::isUnregistered)) { if (recipients.stream().map(Recipient::resolve).anyMatch(it -> it.isUnregistered() || !it.getHasServiceId())) {
throw new NotFoundException("1 or more recipients are not registered!"); throw new NotFoundException("1 or more recipients are not registered!");
} }