Improve logging around sessions.

This commit is contained in:
Greyson Parrelli
2021-10-13 15:29:05 -04:00
parent 168481fee5
commit 0749905909
2 changed files with 7 additions and 5 deletions

View File

@@ -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);
}
}