fix: fix upload of old session after reset
Otherwise we would need to wait for a new inbound session to upload them. It might increase disk usage a bit every 10 minutes.
This commit is contained in:
parent
4f8fce34d5
commit
eb0759caf5
|
|
@ -182,8 +182,6 @@ class KeyManager {
|
|||
if (uploaded) {
|
||||
await client.database
|
||||
?.markInboundGroupSessionAsUploaded(roomId, sessionId);
|
||||
} else {
|
||||
_haveKeysToUpload = true;
|
||||
}
|
||||
});
|
||||
final room = client.getRoomById(roomId);
|
||||
|
|
@ -750,7 +748,6 @@ class KeyManager {
|
|||
}
|
||||
|
||||
bool _isUploadingKeys = false;
|
||||
bool _haveKeysToUpload = true;
|
||||
|
||||
Future<void> backgroundTasks() async {
|
||||
final database = client.database;
|
||||
|
|
@ -760,12 +757,11 @@ class KeyManager {
|
|||
}
|
||||
_isUploadingKeys = true;
|
||||
try {
|
||||
if (!_haveKeysToUpload || !(await isCached())) {
|
||||
if (!(await isCached())) {
|
||||
return; // we can't backup anyways
|
||||
}
|
||||
final dbSessions = await database.getInboundGroupSessionsToUpload();
|
||||
if (dbSessions.isEmpty) {
|
||||
_haveKeysToUpload = false;
|
||||
return; // nothing to do
|
||||
}
|
||||
final privateKey =
|
||||
|
|
|
|||
Loading…
Reference in New Issue