diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ca7fbce..7cdca11d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # ParseLiveQuery-iOS-OSX Changelog +# 2.2.3 + +- Bumps Parse SDK to 1.15.4 and Bolts to 1.9.0, thanks to [marcgovi](https://github.com/marcgovi) +- Updates logging strategy for websockets, thanks to [Joe Szymanski](https://github.com/JoeSzymanski) +- Ensures unsubscribed queries are removed from subscriptions list, thanks to [Joe Szymanski](https://github.com/JoeSzymanski) +- Do not attempt to reconnect if a connection is already in progress, thanks to [Joe Szymanski](https://github.com/JoeSzymanski) + # 2.2.2 - Adds ability to set the clientKey on the connect message, thanks to [bryandel](https://github.com/bryandel) diff --git a/Cartfile b/Cartfile index 2ec8b74d..b93142b9 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,3 @@ github "BoltsFramework/Bolts-Swift" -github "ParsePlatform/Parse-SDK-iOS-OSX" == 1.15.0 +github "ParsePlatform/Parse-SDK-iOS-OSX" == 1.15.4 github "daltoniam/Starscream" == 2.1.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 166efc59..1a289a9f 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,4 +1,4 @@ -github "BoltsFramework/Bolts-ObjC" "1.8.4" +github "BoltsFramework/Bolts-ObjC" "1.9.0" github "BoltsFramework/Bolts-Swift" "1.3.0" +github "ParsePlatform/Parse-SDK-iOS-OSX" "1.15.4" github "daltoniam/Starscream" "2.1.1" -github "ParsePlatform/Parse-SDK-iOS-OSX" "1.15.0" diff --git a/Carthage/Checkouts/Bolts-ObjC b/Carthage/Checkouts/Bolts-ObjC index e64deecb..4dc65427 160000 --- a/Carthage/Checkouts/Bolts-ObjC +++ b/Carthage/Checkouts/Bolts-ObjC @@ -1 +1 @@ -Subproject commit e64deecb2f0e10ac0dbb71f522c7a5b9cafb0b4d +Subproject commit 4dc65427dddc19f78db394941127c1528e55ede8 diff --git a/Carthage/Checkouts/Parse-SDK-iOS-OSX b/Carthage/Checkouts/Parse-SDK-iOS-OSX index ba0afd1a..2032defa 160000 --- a/Carthage/Checkouts/Parse-SDK-iOS-OSX +++ b/Carthage/Checkouts/Parse-SDK-iOS-OSX @@ -1 +1 @@ -Subproject commit ba0afd1a1d8fa2062734c17f0d144819c76beb3e +Subproject commit 2032defa956121c20828b46a4d99a2712474a00a diff --git a/Examples/LiveQueryDemo/main.swift b/Examples/LiveQueryDemo/main.swift index 7d55ea74..537c0a57 100644 --- a/Examples/LiveQueryDemo/main.swift +++ b/Examples/LiveQueryDemo/main.swift @@ -37,7 +37,8 @@ class ChatRoomManager { disconnectFromChatRoom() } - Room.query()?.whereKey("name", equalTo: room).getFirstObjectInBackground().continue({ task in + Room.query()?.whereKey("name", equalTo: room).getFirstObjectInBackground() + .continueOnSuccessWith(block: { task -> Any? in self.currentChatRoom = task.result as? Room print("Connected to room \(self.currentChatRoom?.name ?? "null")") @@ -64,7 +65,8 @@ class ChatRoomManager { } func printPriorMessages() { - messagesQuery.findObjectsInBackground().continue({ task in + messagesQuery.findObjectsInBackground() + .continueOnSuccessWith(block: { task -> Any? in (task.result as? [Message])?.forEach(self.printMessage) return nil @@ -123,7 +125,8 @@ let password = "Enter password for \(username): ".withCString { let chatManager = ChatRoomManager() let inputManager = InputManager(chatManager: chatManager) -PFUser.logInWithUsername(inBackground: username, password: password).continue({ task in +PFUser.logInWithUsername(inBackground: username, password: password) + .continueOnSuccessWith(block: { task -> Any? in print("Enter chat room to connect to: ") return nil }) diff --git a/ParseLiveQuery.podspec b/ParseLiveQuery.podspec index 9509f279..cd822c52 100644 --- a/ParseLiveQuery.podspec +++ b/ParseLiveQuery.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ParseLiveQuery' - s.version = '2.2.2' + s.version = '2.2.3' s.license = { :type => 'BSD' } s.summary = 'Allows for subscriptions to queries in conjunction with parse-server.' s.homepage = 'http://parseplatform.org' diff --git a/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift b/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift index 523ad9b0..5d055e42 100644 --- a/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift +++ b/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift @@ -19,9 +19,9 @@ func objcTask(_ task: Task) -> BFTask where T: AnyObject { taskCompletionSource.trySetCancelled() } else if task.faulted { let error = (task.error as NSError?) ?? NSError(domain: unknownDomain, code: -1, userInfo: nil) - taskCompletionSource.trySetError(error) + taskCompletionSource.trySet(error: error) } else { - taskCompletionSource.trySetResult(task.result) + taskCompletionSource.trySet(result: task.result) } } return taskCompletionSource.task @@ -29,7 +29,7 @@ func objcTask(_ task: Task) -> BFTask where T: AnyObject { func swiftTask(_ task: BFTask) -> Task { let taskCompletionSource = TaskCompletionSource() - task.continue({ task in + task.continueWith(block: { task in if task.isCancelled { taskCompletionSource.tryCancel() } else if let error = task.error , task.isFaulted {