diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIProfile.swift b/Signal/src/ViewControllers/DebugUI/DebugUIProfile.swift index ce718ddaa..5377de584 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIProfile.swift +++ b/Signal/src/ViewControllers/DebugUI/DebugUIProfile.swift @@ -35,6 +35,11 @@ class DebugUIProfile: DebugUIPage { OWSTableItem(title: "Log User Profiles") { profileManager.logUserProfiles() }, + OWSTableItem(title: "Log Profile Key") { + let localProfileKey = profileManager.localProfileKey() + Logger.info("localProfileKey: \(localProfileKey.keyData.hexadecimalString)") + profileManager.logUserProfiles() + }, OWSTableItem(title: "Regenerate Profile/ProfileKey") { profileManager.regenerateLocalProfile() }, diff --git a/SignalMessaging/profiles/OWSProfileManager.m b/SignalMessaging/profiles/OWSProfileManager.m index 87648e85c..7c2534de1 100644 --- a/SignalMessaging/profiles/OWSProfileManager.m +++ b/SignalMessaging/profiles/OWSProfileManager.m @@ -851,6 +851,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error); { OWSUserProfile *userProfile = self.localUserProfile; [userProfile clearWithProfileKey:[OWSAES256Key generateRandomKey] dbConnection:self.dbConnection completion:nil]; + [self.tsAccountManager updateAccountAttributes]; } - (void)addUserToProfileWhitelist:(NSString *)recipientId diff --git a/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m b/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m index ea06c5272..eef3e96ab 100644 --- a/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m +++ b/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m @@ -741,6 +741,17 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O } } +- (dispatch_queue_t)serialQueue +{ + static dispatch_queue_t _serialQueue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _serialQueue = dispatch_queue_create("org.signal.websocket", DISPATCH_QUEUE_SERIAL); + }); + + return _serialQueue; +} + - (void)processWebSocketRequestMessage:(WebSocketProtoWebSocketRequestMessage *)message { OWSAssertIsOnMainThread(); @@ -756,7 +767,7 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O __block OWSBackgroundTask *_Nullable backgroundTask = [OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__]; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + dispatch_async(self.serialQueue, ^{ BOOL success = NO; @try { NSData *_Nullable decryptedPayload =