mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 11:58:43 +00:00
Improve logging around group sends.
This commit is contained in:
parent
6fa2a0f411
commit
d4cdcbe54f
@ -24,6 +24,7 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
import org.thoughtcrime.securesms.jobmanager.JobLogger;
|
||||
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
||||
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
@ -170,7 +171,9 @@ public class PushGroupSendJob extends PushSendJob {
|
||||
else if (!existingNetworkFailures.isEmpty()) target = Stream.of(existingNetworkFailures).map(nf -> nf.getRecipientId(context)).toList();
|
||||
else target = getGroupMessageRecipients(groupRecipient.requireGroupId(), messageId);
|
||||
|
||||
List<SendMessageResult> results = deliver(message, groupRecipient, target);
|
||||
List<SendMessageResult> results = deliver(message, groupRecipient, target);
|
||||
Log.i(TAG, JobLogger.format(this, "Finished send."));
|
||||
|
||||
List<NetworkFailure> networkFailures = Stream.of(results).filter(SendMessageResult::isNetworkFailure).map(result -> new NetworkFailure(Recipient.externalPush(context, result.getAddress()).getId())).toList();
|
||||
List<IdentityKeyMismatch> identityMismatches = Stream.of(results).filter(result -> result.getIdentityFailure() != null).map(result -> new IdentityKeyMismatch(Recipient.externalPush(context, result.getAddress()).getId(), result.getIdentityFailure().getIdentityKey())).toList();
|
||||
Set<RecipientId> successIds = Stream.of(results).filter(result -> result.getSuccess() != null).map(SendMessageResult::getAddress).map(a -> Recipient.externalPush(context, a).getId()).collect(Collectors.toSet());
|
||||
@ -301,6 +304,7 @@ public class PushGroupSendJob extends PushSendJob {
|
||||
.asGroupMessage(group)
|
||||
.build();
|
||||
|
||||
Log.i(TAG, JobLogger.format(this, "Beginning update send."));
|
||||
return messageSender.sendMessage(addresses, unidentifiedAccess, isRecipientUpdate, groupDataMessage);
|
||||
}
|
||||
} else {
|
||||
@ -321,6 +325,7 @@ public class PushGroupSendJob extends PushSendJob {
|
||||
.withPreviews(previews)
|
||||
.build();
|
||||
|
||||
Log.i(TAG, JobLogger.format(this, "Beginning message send."));
|
||||
return messageSender.sendMessage(addresses, unidentifiedAccess, isRecipientUpdate, groupMessage);
|
||||
}
|
||||
}
|
||||
|
@ -1228,25 +1228,25 @@ public class SignalServiceMessageSender {
|
||||
|
||||
if (pipe.isPresent() && !unidentifiedAccess.isPresent()) {
|
||||
try {
|
||||
Log.w(TAG, "Transmitting over pipe...");
|
||||
Log.i(TAG, "[sendMessage] Transmitting over pipe...");
|
||||
SendMessageResponse response = pipe.get().send(messages, Optional.<UnidentifiedAccess>absent());
|
||||
return SendMessageResult.success(recipient, false, response.getNeedsSync() || isMultiDevice.get());
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
Log.w(TAG, "Falling back to new connection...");
|
||||
Log.w(TAG, "[sendMessage] Falling back to new connection...");
|
||||
}
|
||||
} else if (unidentifiedPipe.isPresent() && unidentifiedAccess.isPresent()) {
|
||||
try {
|
||||
Log.w(TAG, "Transmitting over unidentified pipe...");
|
||||
Log.i(TAG, "[sendMessage] Transmitting over unidentified pipe...");
|
||||
SendMessageResponse response = unidentifiedPipe.get().send(messages, unidentifiedAccess);
|
||||
return SendMessageResult.success(recipient, true, response.getNeedsSync() || isMultiDevice.get());
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
Log.w(TAG, "Falling back to new connection...");
|
||||
Log.w(TAG, "[sendMessage] Falling back to new connection...");
|
||||
}
|
||||
}
|
||||
|
||||
Log.w(TAG, "Not transmitting over pipe...");
|
||||
Log.w(TAG, "[sendMessage] Not transmitting over pipe...");
|
||||
SendMessageResponse response = socket.sendMessage(messages, unidentifiedAccess);
|
||||
return SendMessageResult.success(recipient, unidentifiedAccess.isPresent(), response.getNeedsSync() || isMultiDevice.get());
|
||||
|
||||
@ -1282,10 +1282,10 @@ public class SignalServiceMessageSender {
|
||||
|
||||
for (SignalServiceAttachment attachment : attachments.get()) {
|
||||
if (attachment.isStream()) {
|
||||
Log.w(TAG, "Found attachment, creating pointer...");
|
||||
Log.i(TAG, "Found attachment, creating pointer...");
|
||||
pointers.add(createAttachmentPointer(attachment.asStream()));
|
||||
} else if (attachment.isPointer()) {
|
||||
Log.w(TAG, "Including existing attachment pointer...");
|
||||
Log.i(TAG, "Including existing attachment pointer...");
|
||||
pointers.add(createAttachmentPointer(attachment.asPointer()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user