From 87f40c679f582ffadf3bacc6fa569a7563288a91 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 18 Jun 2021 19:45:14 +0300 Subject: [PATCH 1/2] Recreate background sync service if credentials changed --- RiotNSE/NotificationService.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 3ac8cd0bd..85bdde3d5 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -163,7 +163,7 @@ class NotificationService: UNNotificationServiceExtension { MXKAccountManager.shared()?.forceReloadAccounts() self.userAccount = MXKAccountManager.shared()?.activeAccounts.first if let userAccount = userAccount { - if NotificationService.backgroundSyncService == nil { + if NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials { MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE") self.logMemory() NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials) From b042e6558661a18c96dc3dd7de3c1588787c2cb1 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 18 Jun 2021 19:46:00 +0300 Subject: [PATCH 2/2] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index ed19d3fdb..c2c909dde 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,6 +24,7 @@ Changes to be released in next version * VoIP: Handle application inactive state too for VoIP pushes (#4269). * VoIP: Do not terminate the app if protected data not available (#4419). * KeyVerification: Listen for request state changes and show QR reader option when it's ready. + * NSE: Recreate background sync service if credentials changed (#3695). ⚠️ API Changes *