@@ -893,11 +893,8 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
893
893
// Attempt to stop the background task sync loop cleanly, only if the app not already running
894
894
return
895
895
}
896
-
897
- MainActor . assumeIsolated {
898
- userSession? . clientProxy. stopSync ( completion: completion)
899
- clientProxyObserver = nil
900
- }
896
+ userSession? . clientProxy. stopSync ( completion: completion)
897
+ clientProxyObserver = nil
901
898
}
902
899
903
900
private func startSync( ) {
@@ -1039,13 +1036,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
1039
1036
// This is important for the app to keep refreshing in the background
1040
1037
scheduleBackgroundAppRefresh ( )
1041
1038
1042
- /// We have a lot of crashes stemming here which we previously believed are caused by stopSync not being async
1043
- /// on the client proxy side (see the comment on that method). We have now realised that will likely not fix anything but
1044
- /// we also noticed this does not crash on the main thread, even though the whole AppCoordinator is on the Main actor.
1045
- /// As such, we introduced a MainActor conformance on the expirationHandler but we are also assuming main actor
1046
- /// isolated in the `stopSync` method above.
1047
- /// https://sentry.tools.element.io/organizations/element/issues/4477794/
1048
- task. expirationHandler = { @MainActor [ weak self] in
1039
+ task. expirationHandler = { [ weak self] in
1049
1040
MXLog . info ( " Background app refresh task is about to expire. " )
1050
1041
1051
1042
self ? . stopSync ( isBackgroundTask: true ) {
0 commit comments