refactor(mobile): DB repository for asset, backup, sync service (#12953)

* refactor(mobile): DB repository for asset, backup, sync service

* review feedback

* fix bug found by Alex

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Fynn Petersen-Frey
2024-09-30 16:37:30 +02:00
committed by GitHub
parent a2d457b01d
commit 15c04d3056
36 changed files with 873 additions and 450 deletions

View File

@@ -130,7 +130,9 @@ class HashService {
final validHashes = anyNull
? toAdd.where((e) => e.hash.length == 20).toList(growable: false)
: toAdd;
await _assetRepository.upsertDeviceAssets(validHashes);
await _assetRepository
.transaction(() => _assetRepository.upsertDeviceAssets(validHashes));
_log.fine("Hashed ${validHashes.length}/${toHash.length} assets");
}