11import 'dart:async' ;
22
3- import 'package:flutter/foundation.dart' ;
43import 'package:hooks_riverpod/hooks_riverpod.dart' ;
54import 'package:immich_mobile/domain/services/log.service.dart' ;
65import 'package:immich_mobile/domain/utils/isolate_lock_manager.dart' ;
@@ -85,9 +84,7 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
8584 if (isAuthenticated) {
8685 // switch endpoint if needed
8786 final endpoint = await _ref.read (authProvider.notifier).setOpenApiServiceEndpoint ();
88- if (kDebugMode) {
89- debugPrint ("Using server URL: $endpoint " );
90- }
87+ _log.info ("Using server URL: $endpoint " );
9188
9289 if (! Store .isBetaTimelineEnabled) {
9390 final permission = _ref.watch (galleryPermissionNotifier);
@@ -113,10 +110,7 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
113110 break ;
114111 }
115112 } else {
116- // Establish websocket connection first before any sync operations
117- debugPrint ("Connecting websocket on resume" );
118113 _ref.read (websocketProvider.notifier).connect ();
119-
120114 await _handleBetaTimelineResume ();
121115 }
122116
@@ -136,11 +130,9 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
136130 final lockManager = _ref.read (isolateLockManagerProvider (kIsolateLockManagerPort));
137131
138132 // Give isolates time to complete any ongoing database transactions
139- debugPrint ("Waiting for isolates to complete before acquiring lock" );
140133 await Future .delayed (const Duration (milliseconds: 500 ));
141134
142135 lockManager.requestHolderToClose ();
143- debugPrint ("Requested lock holder to close on resume" );
144136
145137 // Add timeout to prevent deadlock on lock acquisition
146138 try {
@@ -151,7 +143,6 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
151143 throw TimeoutException ("Lock acquisition timed out" , const Duration (seconds: 10 ));
152144 },
153145 );
154- debugPrint ("Lock acquired for background sync on resume" );
155146 } catch (e) {
156147 _log.warning ("Failed to acquire lock: $e " );
157148 return ;
@@ -218,7 +209,7 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
218209 // Ensure lock is released even if operations fail
219210 try {
220211 lockManager.releaseLock ();
221- debugPrint ("Lock released after background sync operations" );
212+ _log. fine ("Lock released after background sync operations" );
222213 } catch (lockError) {
223214 _log.warning ("Failed to release lock after error: $lockError " );
224215 }
0 commit comments