π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Remove Library Sharing store interface
Neeraj Gupta888ed676f7cf
diff --git a/mobile/apps/photos/lib/services/library_sharing_service.dart b/mobile/apps/photos/lib/services/library_sharing_service.dartindex c88763126d..44bd102461 100644--- a/mobile/apps/photos/lib/services/library_sharing_service.dart+++ b/mobile/apps/photos/lib/services/library_sharing_service.dart@@ -85,7 +85,7 @@ class LibrarySharingService implements LibrarySharingRepository {CollectionsService? collectionsService,UserService? userService,Configuration? configuration,- required LibrarySharingStore store,+ required LibrarySharingEntityStore store,}) : _collectionsService = collectionsService ?? CollectionsService.instance,_userService = userService ?? UserService.instance,_configuration = configuration ?? Configuration.instance,@@ -94,7 +94,7 @@ class LibrarySharingService implements LibrarySharingRepository {final CollectionsService _collectionsService;final UserService _userService;final Configuration _configuration;- final LibrarySharingStore _store;+ final LibrarySharingEntityStore _store;final _logger = Logger('LibrarySharingService');final _operationLock = Lock();diff --git a/mobile/apps/photos/lib/services/library_sharing_store.dart b/mobile/apps/photos/lib/services/library_sharing_store.dartindex d4f410fe74..be51c2b88f 100644--- a/mobile/apps/photos/lib/services/library_sharing_store.dart+++ b/mobile/apps/photos/lib/services/library_sharing_store.dart@@ -89,20 +89,7 @@ class LibrarySharingConfig {}}-abstract interface class LibrarySharingStore {- Future<void> sync();-- Future<LibrarySharingConfig?> read(int ownerUserID, int recipientUserID);-- Future<List<LibrarySharingConfig>> readAll(int ownerUserID);-- Future<LibrarySharingConfig> write(- int ownerUserID,- LibrarySharingConfig config,- );-}--class LibrarySharingEntityStore implements LibrarySharingStore {+class LibrarySharingEntityStore {LibrarySharingEntityStore(this._entityService);static const _type = EntityType.libraryShare;@@ -111,14 +98,12 @@ class LibrarySharingEntityStore implements LibrarySharingStore {final EntityService _entityService;final _logger = Logger('LibrarySharingEntityStore');- @overrideFuture<void> sync() async {if (await _entityService.syncEntity(_type) < 0) {throw StateError('Could not sync library sharing state');}}- @overrideFuture<LibrarySharingConfig?> read(int ownerUserID,int recipientUserID,@@ -130,7 +115,6 @@ class LibrarySharingEntityStore implements LibrarySharingStore {return entity == null ? null : _decode(entity, ownerUserID);}- @overrideFuture<List<LibrarySharingConfig>> readAll(int ownerUserID) async {final configs = <LibrarySharingConfig>[];for (final entity in await _entityService.getEntities(_type)) {@@ -150,7 +134,6 @@ class LibrarySharingEntityStore implements LibrarySharingStore {return configs;}- @overrideFuture<LibrarySharingConfig> write(int ownerUserID,LibrarySharingConfig config,diff --git a/mobile/apps/photos/test/services/library_sharing_service_test.dart b/mobile/apps/photos/test/services/library_sharing_service_test.dartindex c7302de381..9199297dda 100644--- a/mobile/apps/photos/test/services/library_sharing_service_test.dart+++ b/mobile/apps/photos/test/services/library_sharing_service_test.dart@@ -9,6 +9,7 @@ import 'package:photos/models/metadata/common_keys.dart';import 'package:photos/models/user_details.dart';import 'package:photos/services/account/user_service.dart';import 'package:photos/services/collections_service.dart';+import 'package:photos/services/entity_service.dart';import 'package:photos/services/library_sharing_service.dart';import 'package:photos/services/library_sharing_store.dart';@@ -225,7 +226,9 @@ class _Fixture {service.isAutomaticSharingEnabled(librarySharingTestRecipient.userID);}-class _MemoryLibrarySharingStore implements LibrarySharingStore {+class _MemoryLibrarySharingStore extends LibrarySharingEntityStore {+ _MemoryLibrarySharingStore() : super(_MockEntityService());+LibrarySharingConfig? _config;bool disableOnNextWrite = false;@@ -257,6 +260,8 @@ class _MemoryLibrarySharingStore implements LibrarySharingStore {}}+class _MockEntityService extends Mock implements EntityService {}+class _FakeCollectionsService extends Mock implements CollectionsService {_FakeCollectionsService(this.albums, this.blockedIDs, this.shareError);