Make ending a poll a blocking job.

This commit is contained in:
Michelle Tang
2025-11-05 11:30:14 -05:00
parent 6a6b56e50c
commit a79a059816
11 changed files with 161 additions and 16 deletions

View File

@@ -132,10 +132,11 @@ public final class GroupSendUtil {
boolean isRecipientUpdate,
ContentHint contentHint,
@NonNull SignalServiceDataMessage message,
boolean urgent)
boolean urgent,
CancelationSignal cancelationSignal)
throws IOException, UntrustedIdentityException
{
return sendMessage(context, groupId, getDistributionId(groupId), null, allTargets, isRecipientUpdate, false, DataSendOperation.unresendable(message, contentHint, urgent), null);
return sendMessage(context, groupId, getDistributionId(groupId), null, allTargets, isRecipientUpdate, false, DataSendOperation.unresendable(message, contentHint, urgent), cancelationSignal);
}
/**
@@ -392,6 +393,11 @@ public final class GroupSendUtil {
final AtomicLong entryId = new AtomicLong(-1);
final boolean includeInMessageLog = sendOperation.shouldIncludeInMessageLog();
if (cancelationSignal != null && cancelationSignal.isCanceled()) {
Log.i(TAG, "Send canceled before any sends took place. Returning an empty list.");
return Collections.emptyList();
}
List<SendMessageResult> results = sendOperation.sendWithSenderKey(messageSender, distributionId, targets, access, groupSendEndorsements, isRecipientUpdate, partialResults -> {
if (!includeInMessageLog) {
return;