From ea7b4a2de3d9c64b24db6017de1b198aa3f0c5a0 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 24 Jun 2024 15:04:43 +1000 Subject: [PATCH] Fixed an issue with rapidly going to/from the background MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed an issue where leaving and returning to the app rapidly could leave the app in a state when the database and network are inaccessible • Fixed an issue where bad nodes might not get dropped from the pool (libSession update) --- LibSession-Util | 2 +- Session/Meta/AppDelegate.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LibSession-Util b/LibSession-Util index fdfd9dbb6..c9a98dbb2 160000 --- a/LibSession-Util +++ b/LibSession-Util @@ -1 +1 @@ -Subproject commit fdfd9dbb698e4ce6e6e08dd1b85eec428ab2077e +Subproject commit c9a98dbb2e2ef45aa85075576247d61355269e1c diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index 52eafd404..8dbe48be2 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -211,7 +211,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD // Stop all jobs except for message sending and when completed suspend the database JobRunner.stopAndClearPendingJobs(exceptForVariant: .messageSend, using: dependencies) { - if !self.hasCallOngoing() { + if !self.hasCallOngoing() && Singleton.hasAppContext && Singleton.appContext.isInBackground { LibSession.suspendNetworkAccess() Storage.suspendDatabaseAccess() Log.info("[AppDelegate] completed network and database shutdowns.")