From 94c57dc5f2e4b719e898322a9fe83930c3075539 Mon Sep 17 00:00:00 2001 From: Zack Pollard Date: Tue, 5 Aug 2025 11:35:29 +0100 Subject: [PATCH] chore: handle new sync entity types in the mobile app --- .../lib/domain/services/sync_stream.service.dart | 16 ++++++++++------ .../repositories/sync_api.repository.dart | 6 ++++-- .../1754389095885-ResetAlbumAssetSync.ts | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mobile/lib/domain/services/sync_stream.service.dart b/mobile/lib/domain/services/sync_stream.service.dart index c21a9cade5..7c25fbb345 100644 --- a/mobile/lib/domain/services/sync_stream.service.dart +++ b/mobile/lib/domain/services/sync_stream.service.dart @@ -139,14 +139,18 @@ class SyncStreamService { return _syncStreamRepository.updateAlbumUsersV1(data.cast(), debugLabel: 'backfill'); case SyncEntityType.albumUserDeleteV1: return _syncStreamRepository.deleteAlbumUsersV1(data.cast()); - case SyncEntityType.albumAssetV1: - return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album'); + case SyncEntityType.albumAssetCreateV1: + return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album asset create'); + case SyncEntityType.albumAssetUpdateV1: + return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album asset update'); case SyncEntityType.albumAssetBackfillV1: - return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album backfill'); - case SyncEntityType.albumAssetExifV1: - return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album'); + return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album asset backfill'); + case SyncEntityType.albumAssetExifCreateV1: + return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album asset exif create'); + case SyncEntityType.albumAssetExifUpdateV1: + return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album asset exif update'); case SyncEntityType.albumAssetExifBackfillV1: - return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album backfill'); + return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album asset exif backfill'); case SyncEntityType.albumToAssetV1: return _syncStreamRepository.updateAlbumToAssetsV1(data.cast()); case SyncEntityType.albumToAssetBackfillV1: diff --git a/mobile/lib/infrastructure/repositories/sync_api.repository.dart b/mobile/lib/infrastructure/repositories/sync_api.repository.dart index 78b2a9d957..48c38cf64b 100644 --- a/mobile/lib/infrastructure/repositories/sync_api.repository.dart +++ b/mobile/lib/infrastructure/repositories/sync_api.repository.dart @@ -149,9 +149,11 @@ const _kResponseMap = { SyncEntityType.albumUserV1: SyncAlbumUserV1.fromJson, SyncEntityType.albumUserBackfillV1: SyncAlbumUserV1.fromJson, SyncEntityType.albumUserDeleteV1: SyncAlbumUserDeleteV1.fromJson, - SyncEntityType.albumAssetV1: SyncAssetV1.fromJson, + SyncEntityType.albumAssetCreateV1: SyncAssetV1.fromJson, + SyncEntityType.albumAssetUpdateV1: SyncAssetV1.fromJson, SyncEntityType.albumAssetBackfillV1: SyncAssetV1.fromJson, - SyncEntityType.albumAssetExifV1: SyncAssetExifV1.fromJson, + SyncEntityType.albumAssetExifCreateV1: SyncAssetExifV1.fromJson, + SyncEntityType.albumAssetExifUpdateV1: SyncAssetExifV1.fromJson, SyncEntityType.albumAssetExifBackfillV1: SyncAssetExifV1.fromJson, SyncEntityType.albumToAssetV1: SyncAlbumToAssetV1.fromJson, SyncEntityType.albumToAssetBackfillV1: SyncAlbumToAssetV1.fromJson, diff --git a/server/src/schema/migrations/1754389095885-ResetAlbumAssetSync.ts b/server/src/schema/migrations/1754389095885-ResetAlbumAssetSync.ts index 7a3af0ed5f..34bdfbd4ab 100644 --- a/server/src/schema/migrations/1754389095885-ResetAlbumAssetSync.ts +++ b/server/src/schema/migrations/1754389095885-ResetAlbumAssetSync.ts @@ -4,4 +4,4 @@ export async function up(db: Kysely): Promise { await sql`DELETE FROM session_sync_checkpoint WHERE type IN ('AlbumAssetBackfillV1', 'AlbumAssetExifV1', 'AlbumAssetV1')`.execute(db); } -export async function down(db: Kysely): Promise {} +export async function down(): Promise {}