Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Avoid logging re-init on push in backgrounded main engine

laurenspriem31a0bef2af6b
diff --git a/mobile/apps/photos/lib/main.dart b/mobile/apps/photos/lib/main.dart
index c318817783..43acc75336 100644
--- a/mobile/apps/photos/lib/main.dart
+++ b/mobile/apps/photos/lib/main.dart
@@ -720,6 +720,13 @@ Future<void> _handleBackgroundPush(Object message) async {
if (PushService.shouldSync(message)) {
_logger.info("Foreground is active, skipping background sync from push");
}
+ } else if (!isProcessBg) {
+ // This engine already ran SuperLogging.main: re-entering runWithLogs here
+ // would attach a duplicate log listener and clobber the log prefix.
+ _logger.info("Background push received in backgrounded main engine");
+ if (PushService.shouldSync(message)) {
+ await _sync('firebaseBgSyncMainEngine');
+ }
} else {
runWithLogs(() async {
_logger.info("Background push received, no active foreground");