Skip to content

Commit

Permalink
Do not retry initial sync on fatal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Nov 29, 2022
1 parent 17b45aa commit b97fceb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Riot/Modules/MatrixKit/Models/Account/MXKAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,14 @@ - (void)launchInitialServerSync
NSString *myUserId = self.mxSession.myUser.userId;
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error userInfo:myUserId ? @{kMXKErrorUserIdKey: myUserId} : nil];
}

// If we encounter a fatal sync issue, we do not re-attempt sync as we cannot recover
// from this problem, and the user needs to restart / re-install the app
NSSet *fatalSyncErrors = [NSSet setWithArray:@[MXCryptoErrorDomain]];
if ([fatalSyncErrors containsObject:error.domain])
{
return;
}

// Check if it is a network connectivity issue
AFNetworkReachabilityManager *networkReachabilityManager = [AFNetworkReachabilityManager sharedManager];
Expand Down

0 comments on commit b97fceb

Please sign in to comment.