diff --git a/MatrixSDK/Utils/MXHTTPClient.m b/MatrixSDK/Utils/MXHTTPClient.m index 1f4eac2f0f..63832ff57e 100644 --- a/MatrixSDK/Utils/MXHTTPClient.m +++ b/MatrixSDK/Utils/MXHTTPClient.m @@ -112,6 +112,13 @@ -(id)initWithBaseURL:(NSString *)baseURL accessToken:(NSString *)access_token an [self setUpNetworkReachibility]; [self setUpSSLCertificatesHandler]; + + // Track potential expected session invalidation (seen on iOS10 beta) + [httpManager setSessionDidBecomeInvalidBlock:^(NSURLSession * _Nonnull session, NSError * _Nonnull error) { + + // TODO: Do something like instantiate a new httpManager + NSLog(@"[MXHTTPClient] ERROR: SessionDidBecomeInvalid: %@: %@", session, error); + }]; } return self; } @@ -507,6 +514,7 @@ - (void)cleanupBackgroundTask #pragma mark - Private methods - (void)cancel { + NSLog(@"[MXHTTPClient] cancel"); [httpManager invalidateSessionCancelingTasks:YES]; }