From fc4778e79fa7775fe9b53e21bd5f8db88603e0bf Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 2 Dec 2024 11:09:52 +1100 Subject: [PATCH] don't start other pollers when app is activated in backgroud --- Session/Home/HomeVC.swift | 2 +- Session/Notifications/PushRegistrationManager.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index cc6a99633..554d51218 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -353,7 +353,7 @@ final class HomeVC: BaseVC, LibSessionRespondingViewController, UITableViewDataS ) // Start polling if needed (i.e. if the user just created or restored their Session ID) - if Identity.userExists(), let appDelegate: AppDelegate = UIApplication.shared.delegate as? AppDelegate { + if Identity.userExists(), let appDelegate: AppDelegate = UIApplication.shared.delegate as? AppDelegate, !Singleton.appContext.isInBackground { SNLog("[HomeVC]: Starting pollers...") appDelegate.startPollersIfNeeded() } diff --git a/Session/Notifications/PushRegistrationManager.swift b/Session/Notifications/PushRegistrationManager.swift index d1ed6c10d..6358fef63 100644 --- a/Session/Notifications/PushRegistrationManager.swift +++ b/Session/Notifications/PushRegistrationManager.swift @@ -284,7 +284,8 @@ public enum PushRegistrationError: Error { guard let uuid: String = payload["uuid"] as? String, let caller: String = payload["caller"] as? String, - let timestampMs: Int64 = payload["timestamp"] as? Int64 + let timestampMs: UInt64 = payload["timestamp"] as? UInt64, + TimestampUtils.isWithinOneMinute(timestampMs: timestampMs) else { SessionCallManager.reportFakeCall(info: "Missing payload data") // stringlint:ignore return