mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Revert "Attempt to prevent crashes after expiring background refreshes."
This reverts commit 418daaa90fd9ed6a9fbcdd9d03ee4cde7888c3cd.
This commit is contained in:
committed by
Stefan Ceriu
parent
51886b0c78
commit
0586c2cf54
@@ -893,11 +893,8 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
|||||||
// Attempt to stop the background task sync loop cleanly, only if the app not already running
|
// Attempt to stop the background task sync loop cleanly, only if the app not already running
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
userSession?.clientProxy.stopSync(completion: completion)
|
||||||
MainActor.assumeIsolated {
|
clientProxyObserver = nil
|
||||||
userSession?.clientProxy.stopSync(completion: completion)
|
|
||||||
clientProxyObserver = nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func startSync() {
|
private func startSync() {
|
||||||
@@ -1039,13 +1036,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
|||||||
// This is important for the app to keep refreshing in the background
|
// This is important for the app to keep refreshing in the background
|
||||||
scheduleBackgroundAppRefresh()
|
scheduleBackgroundAppRefresh()
|
||||||
|
|
||||||
/// We have a lot of crashes stemming here which we previously believed are caused by stopSync not being async
|
task.expirationHandler = { [weak self] in
|
||||||
/// on the client proxy side (see the comment on that method). We have now realised that will likely not fix anything but
|
|
||||||
/// we also noticed this does not crash on the main thread, even though the whole AppCoordinator is on the Main actor.
|
|
||||||
/// As such, we introduced a MainActor conformance on the expirationHandler but we are also assuming main actor
|
|
||||||
/// isolated in the `stopSync` method above.
|
|
||||||
/// https://sentry.tools.element.io/organizations/element/issues/4477794/
|
|
||||||
task.expirationHandler = { @MainActor [weak self] in
|
|
||||||
MXLog.info("Background app refresh task is about to expire.")
|
MXLog.info("Background app refresh task is about to expire.")
|
||||||
|
|
||||||
self?.stopSync(isBackgroundTask: true) {
|
self?.stopSync(isBackgroundTask: true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user