diff --git a/mobile/lib/modules/backup/providers/backup.provider.dart b/mobile/lib/modules/backup/providers/backup.provider.dart index 3d8d6414c..8d50eab6e 100644 --- a/mobile/lib/modules/backup/providers/backup.provider.dart +++ b/mobile/lib/modules/backup/providers/backup.provider.dart @@ -375,6 +375,8 @@ class BackupNotifier extends StateNotifier { await _getBackupAlbumsInfo(); await updateServerInfo(); await _updateBackupAssetCount(); + } else { + log.warning("cannot get backup info - background backup is in progress!"); } } diff --git a/mobile/lib/modules/login/providers/authentication.provider.dart b/mobile/lib/modules/login/providers/authentication.provider.dart index 14a094963..34ac29b5f 100644 --- a/mobile/lib/modules/login/providers/authentication.provider.dart +++ b/mobile/lib/modules/login/providers/authentication.provider.dart @@ -5,6 +5,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_udid/flutter_udid.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:immich_mobile/modules/album/providers/album.provider.dart'; +import 'package:immich_mobile/modules/album/providers/shared_album.provider.dart'; import 'package:immich_mobile/shared/models/store.dart'; import 'package:immich_mobile/modules/login/models/authentication_state.model.dart'; import 'package:immich_mobile/shared/models/user.dart'; @@ -21,6 +23,7 @@ class AuthenticationNotifier extends StateNotifier { AuthenticationNotifier( this._apiService, this._db, + this._ref, ) : super( AuthenticationState( deviceId: "", @@ -36,6 +39,8 @@ class AuthenticationNotifier extends StateNotifier { final ApiService _apiService; final Isar _db; + final StateNotifierProviderRef + _ref; final _log = Logger("AuthenticationNotifier"); Future login( @@ -111,6 +116,8 @@ class AuthenticationNotifier extends StateNotifier { Store.delete(StoreKey.currentUser), Store.delete(StoreKey.accessToken), ]); + _ref.invalidate(albumProvider); + _ref.invalidate(sharedAlbumProvider); state = state.copyWith( deviceId: "", @@ -222,5 +229,6 @@ final authenticationProvider = return AuthenticationNotifier( ref.watch(apiServiceProvider), ref.watch(dbProvider), + ref, ); }); diff --git a/mobile/lib/shared/services/sync.service.dart b/mobile/lib/shared/services/sync.service.dart index 08025ed71..d039b3409 100644 --- a/mobile/lib/shared/services/sync.service.dart +++ b/mobile/lib/shared/services/sync.service.dart @@ -401,6 +401,10 @@ class SyncService { final Album a = await Album.remote(dto); await _db.writeTxn(() => _db.albums.store(a)); + } else { + _log.warning( + "Failed to add album from server: assetCount ${dto.assetCount} != " + "asset array length ${dto.assets.length} for album ${dto.albumName}"); } }