From e7ca98fcfec57ee4e573ec081c418bd21b05f1cb Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 6 Jun 2018 13:28:00 -0600 Subject: [PATCH 1/5] Improve logging around socket messages. --- .../src/Network/WebSockets/TSSocketManager.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m index 3d8a17a27..5f72a9bef 100644 --- a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m +++ b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m @@ -75,6 +75,13 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ return self; } +- (void)dealloc +{ + DDLogInfo(@"Dealloc: %@", self.class); + + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + - (void)didSucceedWithResponseObject:(id _Nullable)responseObject { @synchronized(self) @@ -85,6 +92,8 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ self.hasCompleted = YES; } + DDLogInfo(@"%@ %s didSucceedWithResponseObject: %zd, %@", self.logTag, __PRETTY_FUNCTION__, statusCode, error); + OWSAssert(self.success); OWSAssert(self.failure); @@ -532,6 +541,12 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, kSocketTimeoutSeconds * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + DDLogError(@"%@ message timed out: %lld, %@, %@, %zd.", + self.logTag, + socketMessage.requestId, + request.HTTPMethod, + requestPath, + jsonData.length); [weakSocketMessage didFailBeforeSending]; }); } @@ -639,6 +654,8 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ [self.socketMessageMap removeAllObjects]; } + DDLogInfo(@"%@ failAllPendingSocketMessages: %zd.", self.logTag, socketMessages.count); + for (TSSocketMessage *socketMessage in socketMessages) { [socketMessage didFailBeforeSending]; } From 53dac3282ff4183fbdd24cc6640b75876b2a4665 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 6 Jun 2018 13:28:15 -0600 Subject: [PATCH 2/5] "Bump build to 2.26.0.15." --- Signal/Signal-Info.plist | 2 +- SignalShareExtension/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 4a1d6f174..cbac45f98 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -38,7 +38,7 @@ CFBundleVersion - 2.26.0.14 + 2.26.0.15 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 852688ce1..dce6f8052 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.26.0 CFBundleVersion - 2.26.0.14 + 2.26.0.15 ITSAppUsesNonExemptEncryption NSAppTransportSecurity From 3fe63726e0a29e38fa96fc2323db65fa00bed426 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 6 Jun 2018 13:33:27 -0600 Subject: [PATCH 3/5] Improve logging around socket messages. --- SignalServiceKit/src/Network/WebSockets/TSSocketManager.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m index 5f72a9bef..70ebeb0b7 100644 --- a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m +++ b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m @@ -92,7 +92,7 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ self.hasCompleted = YES; } - DDLogInfo(@"%@ %s didSucceedWithResponseObject: %zd, %@", self.logTag, __PRETTY_FUNCTION__, statusCode, error); + DDLogError(@"%@ %s", self.logTag, __PRETTY_FUNCTION__); OWSAssert(self.success); OWSAssert(self.failure); @@ -126,7 +126,7 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ self.hasCompleted = YES; } - DDLogError(@"%@ %s didFailWithStatusCode: %zd, %@", self.logTag, __PRETTY_FUNCTION__, statusCode, error); + DDLogError(@"%@ %s: %zd, %@", self.logTag, __PRETTY_FUNCTION__, statusCode, error); OWSAssert(self.success); OWSAssert(self.failure); From 31d8db57e2f412178e3cfcb5c362ee9f5c2f97da Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 6 Jun 2018 13:33:38 -0600 Subject: [PATCH 4/5] "Bump build to 2.26.0.16." --- Signal/Signal-Info.plist | 2 +- SignalShareExtension/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index cbac45f98..ba0ca2bee 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -38,7 +38,7 @@ CFBundleVersion - 2.26.0.15 + 2.26.0.16 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index dce6f8052..bef84308d 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.26.0 CFBundleVersion - 2.26.0.15 + 2.26.0.16 ITSAppUsesNonExemptEncryption NSAppTransportSecurity From b59140cb3fbedb292718295107a3586556a93725 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 7 Jun 2018 07:50:11 -0600 Subject: [PATCH 5/5] Revert some of the socket sending logging. --- .../src/Network/WebSockets/TSSocketManager.m | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m index 70ebeb0b7..43f7240bd 100644 --- a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m +++ b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m @@ -75,13 +75,6 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ return self; } -- (void)dealloc -{ - DDLogInfo(@"Dealloc: %@", self.class); - - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - - (void)didSucceedWithResponseObject:(id _Nullable)responseObject { @synchronized(self) @@ -92,8 +85,6 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ self.hasCompleted = YES; } - DDLogError(@"%@ %s", self.logTag, __PRETTY_FUNCTION__); - OWSAssert(self.success); OWSAssert(self.failure); @@ -126,7 +117,7 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ self.hasCompleted = YES; } - DDLogError(@"%@ %s: %zd, %@", self.logTag, __PRETTY_FUNCTION__, statusCode, error); + DDLogError(@"%@ %s didFailWithStatusCode: %zd, %@", self.logTag, __PRETTY_FUNCTION__, statusCode, error); OWSAssert(self.success); OWSAssert(self.failure);