mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
conflict resolution
This commit is contained in:
parent
df2f6fbf19
commit
6b471ed903
14 changed files with 70 additions and 62 deletions
|
|
@ -114,10 +114,10 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
|
||||||
configureFileDownloaderNotifications();
|
configureFileDownloaderNotifications();
|
||||||
|
|
||||||
// Notify the host that the background worker service has been initialized and is ready to use
|
// Notify the host that the background worker service has been initialized and is ready to use
|
||||||
_backgroundHostApi.onInitialized();
|
unawaited(_backgroundHostApi.onInitialized());
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe("Failed to initialize background worker", error, stack);
|
_logger.severe("Failed to initialize background worker", error, stack);
|
||||||
await _backgroundHostApi.close();
|
unawaited(_backgroundHostApi.close());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,43 +55,45 @@ class SplashScreenPageState extends ConsumerState<SplashScreenPage> {
|
||||||
final backgroundManager = ref.read(backgroundSyncProvider);
|
final backgroundManager = ref.read(backgroundSyncProvider);
|
||||||
final backupProvider = ref.read(driftBackupProvider.notifier);
|
final backupProvider = ref.read(driftBackupProvider.notifier);
|
||||||
|
|
||||||
ref.read(authProvider.notifier).saveAuthInfo(accessToken: accessToken).then(
|
unawaited(
|
||||||
(_) async {
|
ref.read(authProvider.notifier).saveAuthInfo(accessToken: accessToken).then(
|
||||||
try {
|
(_) async {
|
||||||
wsProvider.connect();
|
try {
|
||||||
infoProvider.getServerInfo();
|
wsProvider.connect();
|
||||||
|
unawaited(infoProvider.getServerInfo());
|
||||||
|
|
||||||
if (Store.isBetaTimelineEnabled) {
|
if (Store.isBetaTimelineEnabled) {
|
||||||
bool syncSuccess = false;
|
bool syncSuccess = false;
|
||||||
await Future.wait([
|
|
||||||
backgroundManager.syncLocal(),
|
|
||||||
backgroundManager.syncRemote().then((success) => syncSuccess = success),
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (syncSuccess) {
|
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
backgroundManager.hashAssets().then((_) {
|
backgroundManager.syncLocal(),
|
||||||
_resumeBackup(backupProvider);
|
backgroundManager.syncRemote().then((success) => syncSuccess = success),
|
||||||
}),
|
|
||||||
_resumeBackup(backupProvider),
|
|
||||||
]);
|
]);
|
||||||
} else {
|
|
||||||
await backgroundManager.hashAssets();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Store.get(StoreKey.syncAlbums, false)) {
|
if (syncSuccess) {
|
||||||
await backgroundManager.syncLinkedAlbum();
|
await Future.wait([
|
||||||
|
backgroundManager.hashAssets().then((_) {
|
||||||
|
_resumeBackup(backupProvider);
|
||||||
|
}),
|
||||||
|
_resumeBackup(backupProvider),
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
await backgroundManager.hashAssets();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Store.get(StoreKey.syncAlbums, false)) {
|
||||||
|
await backgroundManager.syncLinkedAlbum();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
log.severe('Failed establishing connection to the server: $e');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
},
|
||||||
log.severe('Failed establishing connection to the server: $e');
|
onError: (exception) => {
|
||||||
}
|
log.severe('Failed to update auth info with access token: $accessToken'),
|
||||||
},
|
ref.read(authProvider.notifier).logout(),
|
||||||
onError: (exception) => {
|
context.replaceRoute(const LoginRoute()),
|
||||||
log.severe('Failed to update auth info with access token: $accessToken'),
|
},
|
||||||
ref.read(authProvider.notifier).logout(),
|
),
|
||||||
context.replaceRoute(const LoginRoute()),
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
log.severe('Missing crucial offline login info - Logging out completely');
|
log.severe('Missing crucial offline login info - Logging out completely');
|
||||||
|
|
@ -106,11 +108,11 @@ class SplashScreenPageState extends ConsumerState<SplashScreenPage> {
|
||||||
final needBetaMigration = Store.get(StoreKey.needBetaMigration, false);
|
final needBetaMigration = Store.get(StoreKey.needBetaMigration, false);
|
||||||
if (needBetaMigration) {
|
if (needBetaMigration) {
|
||||||
await Store.put(StoreKey.needBetaMigration, false);
|
await Store.put(StoreKey.needBetaMigration, false);
|
||||||
context.router.replaceAll([ChangeExperienceRoute(switchingToBeta: true)]);
|
unawaited(context.router.replaceAll([ChangeExperienceRoute(switchingToBeta: true)]));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.replaceRoute(Store.isBetaTimelineEnabled ? const TabShellRoute() : const TabControllerRoute());
|
unawaited(context.replaceRoute(Store.isBetaTimelineEnabled ? const TabShellRoute() : const TabControllerRoute()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Store.isBetaTimelineEnabled) {
|
if (Store.isBetaTimelineEnabled) {
|
||||||
|
|
@ -130,7 +132,7 @@ class SplashScreenPageState extends ConsumerState<SplashScreenPage> {
|
||||||
if (isEnableBackup) {
|
if (isEnableBackup) {
|
||||||
final currentUser = Store.tryGet(StoreKey.currentUser);
|
final currentUser = Store.tryGet(StoreKey.currentUser);
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
notifier.handleBackupResume(currentUser.id);
|
unawaited(notifier.handleBackupResume(currentUser.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class DriftEditImagePage extends ConsumerWidget {
|
||||||
Logger("SaveEditedImage").warning("Failed to retrieve the saved image back from OS", e);
|
Logger("SaveEditedImage").warning("Failed to retrieve the saved image back from OS", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
ref.read(backgroundSyncProvider).syncLocal(full: true);
|
unawaited(ref.read(backgroundSyncProvider).syncLocal(full: true));
|
||||||
_exitEditing(context);
|
_exitEditing(context);
|
||||||
ImmichToast.show(durationInSecond: 3, context: context, msg: 'Image Saved!');
|
ImmichToast.show(durationInSecond: 3, context: context, msg: 'Image Saved!');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/constants/enums.dart';
|
import 'package:immich_mobile/constants/enums.dart';
|
||||||
|
|
@ -15,7 +17,7 @@ class AdvancedInfoActionButton extends ConsumerWidget {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ref.read(actionProvider.notifier).troubleshoot(source, context);
|
unawaited(ref.read(actionProvider.notifier).troubleshoot(source, context));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class LocalFullImageProvider extends CancellableImageProvider<LocalFullImageProv
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCancelled) {
|
if (isCancelled) {
|
||||||
evict();
|
unawaited(evict());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,11 @@ import 'package:immich_mobile/services/backup.service.dart';
|
||||||
import 'package:immich_mobile/services/backup_album.service.dart';
|
import 'package:immich_mobile/services/backup_album.service.dart';
|
||||||
import 'package:immich_mobile/services/local_notification.service.dart';
|
import 'package:immich_mobile/services/local_notification.service.dart';
|
||||||
import 'package:immich_mobile/utils/backup_progress.dart';
|
import 'package:immich_mobile/utils/backup_progress.dart';
|
||||||
|
import 'package:immich_mobile/utils/debug_print.dart';
|
||||||
import 'package:immich_mobile/widgets/common/immich_toast.dart';
|
import 'package:immich_mobile/widgets/common/immich_toast.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:photo_manager/photo_manager.dart' show PMProgressHandler;
|
import 'package:photo_manager/photo_manager.dart' show PMProgressHandler;
|
||||||
import 'package:immich_mobile/utils/debug_print.dart';
|
|
||||||
|
|
||||||
final manualUploadProvider = StateNotifierProvider<ManualUploadNotifier, ManualUploadState>((ref) {
|
final manualUploadProvider = StateNotifierProvider<ManualUploadNotifier, ManualUploadState>((ref) {
|
||||||
return ManualUploadNotifier(
|
return ManualUploadNotifier(
|
||||||
|
|
@ -295,7 +295,7 @@ class ManualUploadNotifier extends StateNotifier<ManualUploadState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
openAppSettings();
|
unawaited(openAppSettings());
|
||||||
dPrint(() => "[_startUpload] Do not have permission to the gallery");
|
dPrint(() => "[_startUpload] Do not have permission to the gallery");
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:background_downloader/background_downloader.dart';
|
import 'package:background_downloader/background_downloader.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:immich_mobile/constants/enums.dart';
|
import 'package:immich_mobile/constants/enums.dart';
|
||||||
|
|
@ -131,7 +132,7 @@ class ActionNotifier extends Notifier<void> {
|
||||||
if (assets.length > 1) {
|
if (assets.length > 1) {
|
||||||
return ActionResult(count: assets.length, success: false, error: 'Cannot troubleshoot multiple assets');
|
return ActionResult(count: assets.length, success: false, error: 'Cannot troubleshoot multiple assets');
|
||||||
}
|
}
|
||||||
context.pushRoute(AssetTroubleshootRoute(asset: assets.first));
|
unawaited(context.pushRoute(AssetTroubleshootRoute(asset: assets.first)));
|
||||||
|
|
||||||
return ActionResult(count: assets.length, success: true);
|
return ActionResult(count: assets.length, success: true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,15 +138,17 @@ class AssetMediaRepository {
|
||||||
// we dont want to await the share result since the
|
// we dont want to await the share result since the
|
||||||
// "preparing" dialog will not disappear until
|
// "preparing" dialog will not disappear until
|
||||||
final size = context.sizeData;
|
final size = context.sizeData;
|
||||||
Share.shareXFiles(
|
unawaited(
|
||||||
downloadedXFiles,
|
Share.shareXFiles(
|
||||||
sharePositionOrigin: Rect.fromPoints(Offset.zero, Offset(size.width / 3, size.height)),
|
downloadedXFiles,
|
||||||
).then((result) async {
|
sharePositionOrigin: Rect.fromPoints(Offset.zero, Offset(size.width / 3, size.height)),
|
||||||
for (var file in tempFiles) {
|
).then((result) async {
|
||||||
try {
|
for (var file in tempFiles) {
|
||||||
await file.delete();
|
try {
|
||||||
} catch (e) {
|
await file.delete();
|
||||||
_log.warning("Failed to delete temporary file: ${file.path}", e);
|
} catch (e) {
|
||||||
|
_log.warning("Failed to delete temporary file: ${file.path}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,11 @@ import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
import 'package:immich_mobile/domain/models/store.model.dart';
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||||
import 'package:immich_mobile/entities/store.entity.dart';
|
import 'package:immich_mobile/entities/store.entity.dart';
|
||||||
|
import 'package:immich_mobile/utils/debug_print.dart';
|
||||||
import 'package:immich_mobile/utils/url_helper.dart';
|
import 'package:immich_mobile/utils/url_helper.dart';
|
||||||
import 'package:immich_mobile/utils/user_agent.dart';
|
import 'package:immich_mobile/utils/user_agent.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
import 'package:immich_mobile/utils/user_agent.dart';
|
|
||||||
import 'package:immich_mobile/utils/debug_print.dart';
|
|
||||||
|
|
||||||
class ApiService implements Authentication {
|
class ApiService implements Authentication {
|
||||||
late ApiClient _apiClient;
|
late ApiClient _apiClient;
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ class UploadService {
|
||||||
void _handleTaskStatusUpdate(TaskStatusUpdate update) async {
|
void _handleTaskStatusUpdate(TaskStatusUpdate update) async {
|
||||||
switch (update.status) {
|
switch (update.status) {
|
||||||
case TaskStatus.complete:
|
case TaskStatus.complete:
|
||||||
_handleLivePhoto(update);
|
unawaited(_handleLivePhoto(update));
|
||||||
|
|
||||||
if (CurrentPlatform.isIOS) {
|
if (CurrentPlatform.isIOS) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:immich_mobile/domain/models/exif.model.dart';
|
import 'package:immich_mobile/domain/models/exif.model.dart';
|
||||||
|
import 'package:immich_mobile/utils/debug_print.dart';
|
||||||
import 'package:immich_mobile/widgets/map/map_thumbnail.dart';
|
import 'package:immich_mobile/widgets/map/map_thumbnail.dart';
|
||||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:immich_mobile/utils/debug_print.dart';
|
|
||||||
|
|
||||||
class ExifMap extends StatelessWidget {
|
class ExifMap extends StatelessWidget {
|
||||||
final ExifInfo exifInfo;
|
final ExifInfo exifInfo;
|
||||||
|
|
@ -69,7 +69,7 @@ class ExifMap extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
dPrint(() => 'Opening Map Uri: $uri');
|
dPrint(() => 'Opening Map Uri: $uri');
|
||||||
launchUrl(uri);
|
unawaited(launchUrl(uri));
|
||||||
},
|
},
|
||||||
onCreated: onMapCreated,
|
onCreated: onMapCreated,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -194,9 +194,9 @@ class LoginForm extends HookConsumerWidget {
|
||||||
final isBeta = Store.isBetaTimelineEnabled;
|
final isBeta = Store.isBetaTimelineEnabled;
|
||||||
if (isBeta) {
|
if (isBeta) {
|
||||||
await ref.read(galleryPermissionNotifier.notifier).requestGalleryPermission();
|
await ref.read(galleryPermissionNotifier.notifier).requestGalleryPermission();
|
||||||
handleSyncFlow();
|
unawaited(handleSyncFlow());
|
||||||
ref.read(websocketProvider.notifier).connect();
|
ref.read(websocketProvider.notifier).connect();
|
||||||
context.replaceRoute(const TabShellRoute());
|
unawaited(context.replaceRoute(const TabShellRoute()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
unawaited(context.replaceRoute(const TabControllerRoute()));
|
unawaited(context.replaceRoute(const TabControllerRoute()));
|
||||||
|
|
@ -293,8 +293,8 @@ class LoginForm extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
if (isBeta) {
|
if (isBeta) {
|
||||||
await ref.read(galleryPermissionNotifier.notifier).requestGalleryPermission();
|
await ref.read(galleryPermissionNotifier.notifier).requestGalleryPermission();
|
||||||
handleSyncFlow();
|
unawaited(handleSyncFlow());
|
||||||
context.replaceRoute(const TabShellRoute());
|
unawaited(context.replaceRoute(const TabShellRoute()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
unawaited(context.replaceRoute(const TabControllerRoute()));
|
unawaited(context.replaceRoute(const TabControllerRoute()));
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
@ -42,7 +44,7 @@ class BetaTimelineListTile extends ConsumerWidget {
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
context.router.replaceAll([ChangeExperienceRoute(switchingToBeta: value)]);
|
unawaited(context.router.replaceAll([ChangeExperienceRoute(switchingToBeta: value)]));
|
||||||
},
|
},
|
||||||
child: Text("ok".t(context: context)),
|
child: Text("ok".t(context: context)),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
tearDown(() async {
|
tearDown(() async {
|
||||||
sut.dispose();
|
unawaited(sut.dispose());
|
||||||
await controller.close();
|
await controller.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue