diff --git a/mobile/ios/Runner/Sync/MessagesImpl.swift b/mobile/ios/Runner/Sync/MessagesImpl.swift index 181b343c6e..0c364ce63f 100644 --- a/mobile/ios/Runner/Sync/MessagesImpl.swift +++ b/mobile/ios/Runner/Sync/MessagesImpl.swift @@ -144,7 +144,7 @@ class NativeSyncApiImpl: ImmichPlugin, NativeSyncApi, FlutterPlugin { private func getMediaChanges() throws -> SyncDelta { guard #available(iOS 16, *) else { - throw PigeonError(code: kUnSupportedOSError, message: "This feature requires iOS 16 or later.", details: nil) + throw PigeonError(code: kUnsupportedOSError, message: "This feature requires iOS 16 or later.", details: nil) } guard PHPhotoLibrary.authorizationStatus(for: .readWrite) == .authorized else { @@ -437,7 +437,7 @@ class NativeSyncApiImpl: ImmichPlugin, NativeSyncApi, FlutterPlugin { } func getTrashedAssets() throws -> [String: [PlatformAsset]] { - throw PigeonError(code: kUnSupportedOSError, message: "This feature not supported on iOS.", details: nil) + throw PigeonError(code: kUnsupportedOSError, message: "This feature not supported on iOS.", details: nil) } func restoreFromTrashById(mediaId: String, type: Int64, completion: @escaping (Result) -> Void) { @@ -477,7 +477,7 @@ class NativeSyncApiImpl: ImmichPlugin, NativeSyncApi, FlutterPlugin { func getCloudIdForAssetIds(assetIds: [String]) throws -> [CloudIdResult] { guard #available(iOS 16, *) else { - throw PigeonError(code: kUnSupportedOSError, message: "This feature requires iOS 16 or later.", details: nil) + throw PigeonError(code: kUnsupportedOSError, message: "This feature requires iOS 16 or later.", details: nil) } var mappings: [CloudIdResult] = [] diff --git a/mobile/lib/domain/utils/cloud_id_resolver.dart b/mobile/lib/domain/utils/cloud_id_resolver.dart index 21e50e8da4..7610f8d341 100644 --- a/mobile/lib/domain/utils/cloud_id_resolver.dart +++ b/mobile/lib/domain/utils/cloud_id_resolver.dart @@ -28,7 +28,7 @@ Future resolveCloudIds( try { results = await nativeSyncApi.getCloudIdForAssetIds(batch); } on PlatformException catch (error, stack) { - if (error.code == kUnSupportedOSError) { + if (error.code == kUnsupportedOSError) { logger.warning('Cloud IDs are unavailable on this device. Skipping resolution.', error, stack); return; } diff --git a/mobile/lib/domain/utils/migrate_cloud_ids.dart b/mobile/lib/domain/utils/migrate_cloud_ids.dart index 6b1205af67..f2eac043d0 100644 --- a/mobile/lib/domain/utils/migrate_cloud_ids.dart +++ b/mobile/lib/domain/utils/migrate_cloud_ids.dart @@ -8,6 +8,7 @@ import 'package:immich_mobile/constants/constants.dart'; import 'package:immich_mobile/domain/models/asset/asset_metadata.model.dart'; import 'package:immich_mobile/domain/models/asset/base_asset.model.dart'; import 'package:immich_mobile/domain/models/server_capability.model.dart'; +import 'package:immich_mobile/domain/utils/cloud_id_resolver.dart'; import 'package:immich_mobile/extensions/platform_extensions.dart'; import 'package:immich_mobile/infrastructure/repositories/db.repository.dart'; import 'package:immich_mobile/infrastructure/repositories/local_album.repository.dart'; @@ -31,6 +32,7 @@ Future syncCloudIds(ProviderContainer ref) async { if (!CurrentPlatform.isIOS) { return; } + final logger = Logger('migrateCloudIds'); final db = ref.read(driftProvider); diff --git a/mobile/pigeon/native_sync_api.dart b/mobile/pigeon/native_sync_api.dart index f5a6d55e02..03f560fbf1 100644 --- a/mobile/pigeon/native_sync_api.dart +++ b/mobile/pigeon/native_sync_api.dart @@ -11,7 +11,7 @@ import 'package:pigeon/pigeon.dart'; dartPackageName: 'immich_mobile', ), ) -const String kUnSupportedOSError = 'UNSUPPORTED_OS'; +const String kUnsupportedOSError = 'UNSUPPORTED_OS'; enum PlatformAssetPlaybackStyle { unknown, image, video, imageAnimated, livePhoto, videoLooping } diff --git a/mobile/test/medium/utils/migrate_cloud_ids_test.dart b/mobile/test/medium/utils/migrate_cloud_ids_test.dart index 38585dd755..ce9f0385c0 100644 --- a/mobile/test/medium/utils/migrate_cloud_ids_test.dart +++ b/mobile/test/medium/utils/migrate_cloud_ids_test.dart @@ -87,7 +87,7 @@ void main() { final ids = List.generate(kCloudIdChunkSize + 1, (i) => 'asset-$i'); when( () => mockNativeSyncApi.getCloudIdForAssetIds(any()), - ).thenThrow(PlatformException(code: kUnSupportedOSError)); + ).thenThrow(PlatformException(code: kUnsupportedOSError)); await resolveCloudIds(mockNativeSyncApi, albumRepository, ids);