From f526475f2fdf05a24bb7455e28fdfd8b0db69a9c Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 4 Jun 2021 08:12:23 +1000 Subject: [PATCH 1/3] Fix minor deep linking bug --- Session/DMs/NewDMVC.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Session/DMs/NewDMVC.swift b/Session/DMs/NewDMVC.swift index c6ff34141..e0f2eaa40 100644 --- a/Session/DMs/NewDMVC.swift +++ b/Session/DMs/NewDMVC.swift @@ -274,7 +274,7 @@ private final class EnterPublicKeyVC : UIViewController { // MARK: General func setSessionID(to sessionID: String){ - publicKeyTextView.text = sessionID + publicKeyTextView.insertText(sessionID) } func constrainHeight(to height: CGFloat) { From 86c2c394253b40595e7f702f4338dfd2686972f5 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 4 Jun 2021 08:16:54 +1000 Subject: [PATCH 2/3] Fix background polling crash --- SessionMessagingKit/Jobs/AttachmentDownloadJob.swift | 4 +++- SessionMessagingKit/Jobs/AttachmentUploadJob.swift | 4 +++- SessionMessagingKit/Jobs/MessageReceiveJob.swift | 4 +++- SessionMessagingKit/Jobs/MessageSendJob.swift | 4 +++- SessionMessagingKit/Jobs/NotifyPNServerJob.swift | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/SessionMessagingKit/Jobs/AttachmentDownloadJob.swift b/SessionMessagingKit/Jobs/AttachmentDownloadJob.swift index 85e251553..b5eb03556 100644 --- a/SessionMessagingKit/Jobs/AttachmentDownloadJob.swift +++ b/SessionMessagingKit/Jobs/AttachmentDownloadJob.swift @@ -59,7 +59,9 @@ public final class AttachmentDownloadJob : NSObject, Job, NSCoding { // NSObject // MARK: Running public func execute() { - JobQueue.currentlyExecutingJobs.insert(id!) + if let id = id { + JobQueue.currentlyExecutingJobs.insert(id) + } guard !isDeferred else { return } if TSAttachment.fetch(uniqueId: attachmentID) is TSAttachmentStream { // FIXME: It's not clear * how * this happens, but apparently we can get to this point diff --git a/SessionMessagingKit/Jobs/AttachmentUploadJob.swift b/SessionMessagingKit/Jobs/AttachmentUploadJob.swift index 584824982..e3f9a1df6 100644 --- a/SessionMessagingKit/Jobs/AttachmentUploadJob.swift +++ b/SessionMessagingKit/Jobs/AttachmentUploadJob.swift @@ -60,7 +60,9 @@ public final class AttachmentUploadJob : NSObject, Job, NSCoding { // NSObject/N // MARK: Running public func execute() { - JobQueue.currentlyExecutingJobs.insert(id!) + if let id = id { + JobQueue.currentlyExecutingJobs.insert(id) + } guard let stream = TSAttachment.fetch(uniqueId: attachmentID) as? TSAttachmentStream else { return handleFailure(error: Error.noAttachment) } diff --git a/SessionMessagingKit/Jobs/MessageReceiveJob.swift b/SessionMessagingKit/Jobs/MessageReceiveJob.swift index 48e919ab8..227dfa591 100644 --- a/SessionMessagingKit/Jobs/MessageReceiveJob.swift +++ b/SessionMessagingKit/Jobs/MessageReceiveJob.swift @@ -54,7 +54,9 @@ public final class MessageReceiveJob : NSObject, Job, NSCoding { // NSObject/NSC } public func execute() -> Promise { - JobQueue.currentlyExecutingJobs.insert(id!) + if let id = id { // Can be nil (e.g. when background polling) + JobQueue.currentlyExecutingJobs.insert(id) + } let (promise, seal) = Promise.pending() SNMessagingKitConfiguration.shared.storage.write(with: { transaction in // Intentionally capture self do { diff --git a/SessionMessagingKit/Jobs/MessageSendJob.swift b/SessionMessagingKit/Jobs/MessageSendJob.swift index c894e6460..aed0268a1 100644 --- a/SessionMessagingKit/Jobs/MessageSendJob.swift +++ b/SessionMessagingKit/Jobs/MessageSendJob.swift @@ -69,7 +69,9 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi // MARK: Running public func execute() { - JobQueue.currentlyExecutingJobs.insert(id!) + if let id = id { + JobQueue.currentlyExecutingJobs.insert(id) + } let storage = SNMessagingKitConfiguration.shared.storage if let message = message as? VisibleMessage { guard TSOutgoingMessage.find(withTimestamp: message.sentTimestamp!) != nil else { return } // The message has been deleted diff --git a/SessionMessagingKit/Jobs/NotifyPNServerJob.swift b/SessionMessagingKit/Jobs/NotifyPNServerJob.swift index c243fa30a..82c57b3f3 100644 --- a/SessionMessagingKit/Jobs/NotifyPNServerJob.swift +++ b/SessionMessagingKit/Jobs/NotifyPNServerJob.swift @@ -38,7 +38,9 @@ public final class NotifyPNServerJob : NSObject, Job, NSCoding { // NSObject/NSC } public func execute() -> Promise { - JobQueue.currentlyExecutingJobs.insert(id!) + if let id = id { + JobQueue.currentlyExecutingJobs.insert(id) + } let server = PushNotificationAPI.server let parameters = [ "data" : message.data.description, "send_to" : message.recipient ] let url = URL(string: "\(server)/notify")! From ae4e7810551e5eb1fbcaee471d37a4a2dedee7b7 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 4 Jun 2021 08:17:57 +1000 Subject: [PATCH 3/3] Update build number --- Session.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index d5277078c..03d39bab8 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5062,7 +5062,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 254; + CURRENT_PROJECT_VERSION = 255; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5131,7 +5131,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 254; + CURRENT_PROJECT_VERSION = 255; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5192,7 +5192,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 254; + CURRENT_PROJECT_VERSION = 255; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5262,7 +5262,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 254; + CURRENT_PROJECT_VERSION = 255; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6147,7 +6147,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 254; + CURRENT_PROJECT_VERSION = 255; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6215,7 +6215,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 254; + CURRENT_PROJECT_VERSION = 255; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)",