1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(mobile): Start up from splash screen does not trigger foreground backup (#1042)

This commit is contained in:
Alex 2022-12-01 09:20:53 -06:00 committed by GitHub
parent a384798779
commit a3971543b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 28 deletions

View File

@ -5,17 +5,17 @@
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000345"> <testcase classname="fastlane.lanes" name="0: default_platform" time="0.000201">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="1: bundleRelease" time="123.14891"> <testcase classname="fastlane.lanes" name="1: bundleRelease" time="63.132489">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="2: upload_to_play_store" time="39.270764"> <testcase classname="fastlane.lanes" name="2: upload_to_play_store" time="38.15883">
</testcase> </testcase>

View File

@ -360,7 +360,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72; CURRENT_PROJECT_VERSION = 73;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -495,7 +495,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72; CURRENT_PROJECT_VERSION = 73;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -522,7 +522,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72; CURRENT_PROJECT_VERSION = 73;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.36.1</string> <string>1.37.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>72</string> <string>73</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true /> <true />
<key>MGLMapboxMetricsEnabledSettingShownInApp</key> <key>MGLMapboxMetricsEnabledSettingShownInApp</key>

View File

@ -5,32 +5,32 @@
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000358"> <testcase classname="fastlane.lanes" name="0: default_platform" time="0.000198">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="1: increment_version_number" time="0.721922"> <testcase classname="fastlane.lanes" name="1: increment_version_number" time="1.628003">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="2: latest_testflight_build_number" time="6.015111"> <testcase classname="fastlane.lanes" name="2: latest_testflight_build_number" time="8.590581">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="3: increment_build_number" time="0.656945"> <testcase classname="fastlane.lanes" name="3: increment_build_number" time="0.617507">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="4: build_app" time="75.686541"> <testcase classname="fastlane.lanes" name="4: build_app" time="81.79009">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="5: upload_to_testflight" time="68.644406"> <testcase classname="fastlane.lanes" name="5: upload_to_testflight" time="74.632018">
</testcase> </testcase>

View File

@ -69,7 +69,6 @@ class BackupNotifier extends StateNotifier<BackUpState> {
final AuthenticationState _authState; final AuthenticationState _authState;
final BackgroundService _backgroundService; final BackgroundService _backgroundService;
final Ref ref; final Ref ref;
var isGettingBackupInfo = false;
/// ///
/// UI INTERACTION /// UI INTERACTION
@ -375,20 +374,14 @@ class BackupNotifier extends StateNotifier<BackUpState> {
/// which albums are selected or excluded /// which albums are selected or excluded
/// and then update the UI according to those information /// and then update the UI according to those information
Future<void> getBackupInfo() async { Future<void> getBackupInfo() async {
if (!isGettingBackupInfo) { var isEnabled = await _backgroundService.isBackgroundBackupEnabled();
isGettingBackupInfo = true;
var isEnabled = await _backgroundService.isBackgroundBackupEnabled(); state = state.copyWith(backgroundBackup: isEnabled);
state = state.copyWith(backgroundBackup: isEnabled); if (state.backupProgress != BackUpProgressEnum.inBackground) {
await _getBackupAlbumsInfo();
if (state.backupProgress != BackUpProgressEnum.inBackground) { await _updateServerInfo();
await _getBackupAlbumsInfo(); await _updateBackupAssetCount();
await _updateServerInfo();
await _updateBackupAssetCount();
}
isGettingBackupInfo = false;
} }
} }
@ -415,6 +408,7 @@ class BackupNotifier extends StateNotifier<BackUpState> {
/// Invoke backup process /// Invoke backup process
Future<void> startBackupProcess() async { Future<void> startBackupProcess() async {
debugPrint("Start backup process");
assert(state.backupProgress == BackUpProgressEnum.idle); assert(state.backupProgress == BackUpProgressEnum.idle);
state = state.copyWith(backupProgress: BackUpProgressEnum.inProgress); state = state.copyWith(backupProgress: BackUpProgressEnum.inProgress);
@ -431,7 +425,6 @@ class BackupNotifier extends StateNotifier<BackUpState> {
} }
Set<AssetEntity> assetsWillBeBackup = Set.from(state.allUniqueAssets); Set<AssetEntity> assetsWillBeBackup = Set.from(state.allUniqueAssets);
// Remove item that has already been backed up // Remove item that has already been backed up
for (var assetId in state.allAssetsInDatabase) { for (var assetId in state.allAssetsInDatabase) {
assetsWillBeBackup.removeWhere((e) => e.id == assetId); assetsWillBeBackup.removeWhere((e) => e.id == assetId);