From 2b0bc532470043374ff40906786f1776936d9287 Mon Sep 17 00:00:00 2001 From: otsmr Date: Sat, 18 Oct 2025 00:13:47 +0200 Subject: [PATCH] improve logging --- lib/src/database/daos/signal_dao.dart | 5 +++-- lib/src/database/signal/connect_pre_key_store.dart | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/database/daos/signal_dao.dart b/lib/src/database/daos/signal_dao.dart index 0d0ba84..e8f4732 100644 --- a/lib/src/database/daos/signal_dao.dart +++ b/lib/src/database/daos/signal_dao.dart @@ -57,6 +57,7 @@ class SignalDao extends DatabaseAccessor with _$SignalDaoMixin { tbl.preKeyId.equals(preKey.preKeyId), )) .go(); + Log.info('Using prekey ${preKey.preKeyId} for $contactId'); return preKey; } return null; @@ -96,7 +97,7 @@ class SignalDao extends DatabaseAccessor with _$SignalDaoMixin { // Deletion is a workaround for the issue, that own pre keys where deleted after 40 days, while they could be 30days // on the server + 25 days on the others device old, resulting in the issue that the receiver could not decrypt the // messages... - await (delete(signalContactSignedPreKeys) + await (delete(signalContactPreKeys) ..where( (t) => (t.createdAt.isSmallerThanValue( DateTime(2025, 10, 10), @@ -104,7 +105,7 @@ class SignalDao extends DatabaseAccessor with _$SignalDaoMixin { )) .go(); // other pre keys are valid 100 days - await (delete(signalContactSignedPreKeys) + await (delete(signalContactPreKeys) ..where( (t) => (t.createdAt.isSmallerThanValue( DateTime.now().subtract( diff --git a/lib/src/database/signal/connect_pre_key_store.dart b/lib/src/database/signal/connect_pre_key_store.dart index 934b4f2..6fb193b 100644 --- a/lib/src/database/signal/connect_pre_key_store.dart +++ b/lib/src/database/signal/connect_pre_key_store.dart @@ -21,6 +21,7 @@ class ConnectPreKeyStore extends PreKeyStore { if (preKeyRecord.isEmpty) { throw InvalidKeyIdException('No such preKey record! - $preKeyId'); } + Log.info('Contact used preKey $preKeyId'); final preKey = preKeyRecord.first.preKey; return PreKeyRecord.fromBuffer(preKey); }