improve logging

This commit is contained in:
otsmr 2025-10-18 00:13:47 +02:00
parent 5b486f6b68
commit 2b0bc53247
2 changed files with 4 additions and 2 deletions

View file

@ -57,6 +57,7 @@ class SignalDao extends DatabaseAccessor<TwonlyDatabase> 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<TwonlyDatabase> 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<TwonlyDatabase> with _$SignalDaoMixin {
))
.go();
// other pre keys are valid 100 days
await (delete(signalContactSignedPreKeys)
await (delete(signalContactPreKeys)
..where(
(t) => (t.createdAt.isSmallerThanValue(
DateTime.now().subtract(

View file

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