mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-23 18:21:50 +01:00
Improve logging around message sending.
There were some message types where we didn't log the timestamp. The timestamp is important for debugging issues (let's us locate an error more precisely in the logs).
This commit is contained in:
@@ -181,9 +181,9 @@ public class LogSectionSystemInfo implements LogSection {
|
||||
|
||||
if (aci != null) {
|
||||
String aciString = aci.toString();
|
||||
String lastTwo = aciString.substring(aciString.length() - 2);
|
||||
String lastThree = aciString.substring(aciString.length() - 3);
|
||||
|
||||
return "********-****-****-****-**********" + lastTwo;
|
||||
return "********-****-****-****-*********" + lastThree;
|
||||
} else {
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
+20
@@ -212,6 +212,8 @@ public class SignalServiceMessageSender {
|
||||
boolean includePniSignature)
|
||||
throws IOException, UntrustedIdentityException
|
||||
{
|
||||
Log.d(TAG, "[" + message.getWhen() + "] Sending a receipt.");
|
||||
|
||||
Content content = createReceiptContent(message);
|
||||
|
||||
if (includePniSignature) {
|
||||
@@ -235,6 +237,8 @@ public class SignalServiceMessageSender {
|
||||
throws IOException, UntrustedIdentityException
|
||||
|
||||
{
|
||||
Log.d(TAG, "[" + errorMessage.getTimestamp() + "] Sending a retry receipt.");
|
||||
|
||||
PlaintextContent content = new PlaintextContent(errorMessage);
|
||||
EnvelopeContent envelopeContent = EnvelopeContent.plaintext(content, groupId);
|
||||
|
||||
@@ -250,6 +254,8 @@ public class SignalServiceMessageSender {
|
||||
CancelationSignal cancelationSignal)
|
||||
throws IOException
|
||||
{
|
||||
Log.d(TAG, "[" + message.getTimestamp() + "] Sending a typing message to " + recipients.size() + " recipient(s) using 1:1 messages.");
|
||||
|
||||
Content content = createTypingContent(message);
|
||||
EnvelopeContent envelopeContent = EnvelopeContent.encrypted(content, ContentHint.IMPLICIT, Optional.empty());
|
||||
|
||||
@@ -265,6 +271,8 @@ public class SignalServiceMessageSender {
|
||||
SignalServiceTypingMessage message)
|
||||
throws IOException, UntrustedIdentityException, InvalidKeyException, NoSessionException, InvalidRegistrationIdException
|
||||
{
|
||||
Log.d(TAG, "[" + message.getTimestamp() + "] Sending a typing message to " + recipients.size() + " recipient(s) using sender key.");
|
||||
|
||||
Content content = createTypingContent(message);
|
||||
sendGroupMessage(distributionId, recipients, unidentifiedAccess, message.getTimestamp(), content, ContentHint.IMPLICIT, message.getGroupId(), true, SenderKeyGroupEvents.EMPTY, false, false);
|
||||
}
|
||||
@@ -279,6 +287,8 @@ public class SignalServiceMessageSender {
|
||||
Set<SignalServiceStoryMessageRecipient> manifest)
|
||||
throws IOException, UntrustedIdentityException
|
||||
{
|
||||
Log.d(TAG, "[" + timestamp + "] Sending a story sync message.");
|
||||
|
||||
if (manifest.isEmpty() && !message.getGroupContext().isPresent()) {
|
||||
Log.w(TAG, "Refusing to send sync message for empty manifest in non-group story.");
|
||||
return;
|
||||
@@ -302,6 +312,8 @@ public class SignalServiceMessageSender {
|
||||
Set<SignalServiceStoryMessageRecipient> manifest)
|
||||
throws IOException, UntrustedIdentityException, InvalidKeyException, NoSessionException, InvalidRegistrationIdException
|
||||
{
|
||||
Log.d(TAG, "[" + timestamp + "] Sending a story.");
|
||||
|
||||
Content content = createStoryContent(message);
|
||||
List<SendMessageResult> sendMessageResults = sendGroupMessage(distributionId, recipients, unidentifiedAccess, timestamp, content, ContentHint.IMPLICIT, groupId, false, SenderKeyGroupEvents.EMPTY, false, true);
|
||||
|
||||
@@ -325,6 +337,8 @@ public class SignalServiceMessageSender {
|
||||
SignalServiceCallMessage message)
|
||||
throws IOException, UntrustedIdentityException
|
||||
{
|
||||
Log.d(TAG, "[" + message.getTimestamp() + "] Sending a call message (single recipient).");
|
||||
|
||||
Content content = createCallContent(message);
|
||||
EnvelopeContent envelopeContent = EnvelopeContent.encrypted(content, ContentHint.DEFAULT, Optional.empty());
|
||||
|
||||
@@ -336,6 +350,8 @@ public class SignalServiceMessageSender {
|
||||
SignalServiceCallMessage message)
|
||||
throws IOException
|
||||
{
|
||||
Log.d(TAG, "[" + message.getTimestamp() + "] Sending a call message (multiple recipients).");
|
||||
|
||||
Content content = createCallContent(message);
|
||||
EnvelopeContent envelopeContent = EnvelopeContent.encrypted(content, ContentHint.DEFAULT, Optional.empty());
|
||||
|
||||
@@ -348,6 +364,8 @@ public class SignalServiceMessageSender {
|
||||
SignalServiceCallMessage message)
|
||||
throws IOException, UntrustedIdentityException, InvalidKeyException, NoSessionException, InvalidRegistrationIdException
|
||||
{
|
||||
Log.d(TAG, "[" + message.getTimestamp() + "] Sending a call message (sender key).");
|
||||
|
||||
Content content = createCallContent(message);
|
||||
return sendGroupMessage(distributionId, recipients, unidentifiedAccess, message.getTimestamp().get(), content, ContentHint.IMPLICIT, message.getGroupId(), false, SenderKeyGroupEvents.EMPTY, message.isUrgent(), false);
|
||||
}
|
||||
@@ -464,6 +482,8 @@ public class SignalServiceMessageSender {
|
||||
boolean urgent)
|
||||
throws UntrustedIdentityException, IOException
|
||||
{
|
||||
Log.d(TAG, "[" + timestamp + "] Resending content.");
|
||||
|
||||
EnvelopeContent envelopeContent = EnvelopeContent.encrypted(content, contentHint, groupId);
|
||||
Optional<UnidentifiedAccess> access = unidentifiedAccess.isPresent() ? unidentifiedAccess.get().getTargetUnidentifiedAccess() : Optional.empty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user