Improve logging around sessions.

fork-5.53.8
Greyson Parrelli 2021-10-13 15:29:05 -04:00
rodzic 168481fee5
commit 0749905909
2 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -39,7 +39,7 @@ public class TextSecureSessionStore implements SignalServiceSessionStore {
SessionRecord sessionRecord = DatabaseFactory.getSessionDatabase(context).load(address);
if (sessionRecord == null) {
Log.w(TAG, "No existing session information found.");
Log.w(TAG, "No existing session information found for " + address);
return new SessionRecord();
}
@ -59,7 +59,7 @@ public class TextSecureSessionStore implements SignalServiceSessionStore {
}
if (sessionRecords.stream().anyMatch(Objects::isNull)) {
throw new NoSessionException("Failed to find at least one session.");
throw new NoSessionException("Failed to find one or more sessions.");
}
return sessionRecords;
@ -87,6 +87,7 @@ public class TextSecureSessionStore implements SignalServiceSessionStore {
@Override
public void deleteSession(SignalProtocolAddress address) {
synchronized (LOCK) {
Log.w(TAG, "Deleting session for " + address);
DatabaseFactory.getSessionDatabase(context).delete(address);
}
}
@ -94,6 +95,7 @@ public class TextSecureSessionStore implements SignalServiceSessionStore {
@Override
public void deleteAllSessions(String name) {
synchronized (LOCK) {
Log.w(TAG, "Deleting all sessions for " + name);
DatabaseFactory.getSessionDatabase(context).deleteAllFor(name);
}
}

Wyświetl plik

@ -239,7 +239,7 @@ public final class MessageContentProcessor {
PendingRetryReceiptModel pending = ApplicationDependencies.getPendingRetryReceiptCache().get(senderRecipient.getId(), content.getTimestamp());
long receivedTime = handlePendingRetry(pending, content, threadRecipient);
log(String.valueOf(content.getTimestamp()), "Beginning message processing. Sender: " + senderRecipient.getId() + " | " + senderRecipient.requireServiceId());
log(String.valueOf(content.getTimestamp()), "Beginning message processing. Sender: " + senderRecipient.getId() + " | " + senderRecipient.requireServiceId() + "." + content.getSenderDevice());
if (content.getDataMessage().isPresent()) {
GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(context);
@ -1856,7 +1856,7 @@ public final class MessageContentProcessor {
DatabaseFactory.getSenderKeySharedDatabase(context).delete(distributionId, Collections.singleton(requesterAddress));
if (messageLogEntry != null) {
warn(content.getTimestamp(), "[RetryReceipt-SK] Found MSL entry for " + requester.getId() + " with timestamp " + sentTimestamp + ". Scheduling a resend.");
warn(content.getTimestamp(), "[RetryReceipt-SK] Found MSL entry for " + requester.getId() + " (" + requesterAddress + ") with timestamp " + sentTimestamp + ". Scheduling a resend.");
ApplicationDependencies.getJobManager().add(new ResendMessageJob(messageLogEntry.getRecipientId(),
messageLogEntry.getDateSent(),
@ -1865,7 +1865,7 @@ public final class MessageContentProcessor {
groupId,
distributionId));
} else {
warn(content.getTimestamp(), "[RetryReceipt-SK] Unable to find MSL entry for " + requester.getId() + " with timestamp " + sentTimestamp + ".");
warn(content.getTimestamp(), "[RetryReceipt-SK] Unable to find MSL entry for " + requester.getId() + " (" + requesterAddress + ") with timestamp " + sentTimestamp + ".");
Optional<GroupRecord> groupRecord = DatabaseFactory.getGroupDatabase(context).getGroup(groupId);