diff --git a/wire-ios-sync-engine/Source/SessionManager/SessionManager+VoIPPushManagerDelegate.swift b/wire-ios-sync-engine/Source/SessionManager/SessionManager+VoIPPushManagerDelegate.swift index 05e2ab8d326..35d141e4394 100644 --- a/wire-ios-sync-engine/Source/SessionManager/SessionManager+VoIPPushManagerDelegate.swift +++ b/wire-ios-sync-engine/Source/SessionManager/SessionManager+VoIPPushManagerDelegate.swift @@ -64,10 +64,16 @@ extension SessionManager: VoIPPushManagerDelegate { WireLogger.calling.info("process pending call events preemptively") guard - let account = accountManager.account(with: accountID), + let account = accountManager.account(with: accountID) + else { + WireLogger.calling.error("failed to process pending call events preemptively: account not found for \(accountID))") + return + } + + guard let activity = BackgroundActivityFactory.shared.startBackgroundActivity(name: "processPendingCallEvents") else { - WireLogger.calling.error("failed to process pending call events preemptively") + WireLogger.calling.error("failed to process pending call events preemptively: activity not started") return } diff --git a/wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession.swift b/wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession.swift index 901edd3141b..fa5b4b4ac85 100644 --- a/wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession.swift +++ b/wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession.swift @@ -1037,12 +1037,13 @@ extension ZMUserSession: ZMSyncStateDelegate { WireLogger.updateEvent.info("process pending call events") Task { do { + // why not processing only the call events (should be stored here?) try await updateEventProcessor!.processBufferedEvents() await managedObjectContext.perform { completionHandler() } } catch { - WireLogger.mls.error("Failed to process pending call events: \(String(reflecting: error))") + WireLogger.updateEvent.error("Failed to process pending call events: \(String(reflecting: error))") } } } diff --git a/wire-ios-transport/Source/Background/BackgroundActivityFactory.swift b/wire-ios-transport/Source/Background/BackgroundActivityFactory.swift index 9f6ade90ad5..6a19027d0e0 100644 --- a/wire-ios-transport/Source/Background/BackgroundActivityFactory.swift +++ b/wire-ios-transport/Source/Background/BackgroundActivityFactory.swift @@ -190,7 +190,7 @@ public final class BackgroundActivityFactory: NSObject { /// Called on main queue when the background timer is about to expire. private func handleExpiration() { - guard let activityManager else { + guard activityManager != nil else { WireLogger.backgroundActivity.warn( "Handle expiration: failed, activityManager is nil", attributes: .safePublic