From 79b760f874c6e4c6c778734f5b85f591862530c1 Mon Sep 17 00:00:00 2001 From: Corey Date: Tue, 30 Nov 2021 14:40:05 -0500 Subject: [PATCH] fix: query objects doesn't dispatch properly (#293) --- CHANGELOG.md | 8 +++++++- README.md | 2 +- Sources/ParseSwift/API/API+NonParseBodyCommand.swift | 12 +++++++----- Sources/ParseSwift/ParseConstants.swift | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e323f5e0..3037e1e9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,15 @@ ### main -[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.3.0...main) +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.3.1...main) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 2.3.1 +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.3.0...2.3.1) + +__Fixes__ +- Fixed an issue querying an object didn't dispatch to the proper queue which can cause app crashes ([#293](https://github.com/parse-community/Parse-Swift/pull/293)), thanks to [Corey Baker](https://github.com/cbaker6). + ### 2.3.0 [Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.6...2.3.0) diff --git a/README.md b/README.md index 29d0cce59..1b9e2cad8 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ import PackageDescription let package = Package( name: "YOUR_PROJECT_NAME", dependencies: [ - .package(url: "https://github.com/parse-community/Parse-Swift", from: "2.2.4"), + .package(url: "https://github.com/parse-community/Parse-Swift", from: "2.3.1"), ] ) ``` diff --git a/Sources/ParseSwift/API/API+NonParseBodyCommand.swift b/Sources/ParseSwift/API/API+NonParseBodyCommand.swift index 8fca41e9b..19fbe501c 100644 --- a/Sources/ParseSwift/API/API+NonParseBodyCommand.swift +++ b/Sources/ParseSwift/API/API+NonParseBodyCommand.swift @@ -64,12 +64,14 @@ internal extension API { URLSession.parse.dataTask(with: urlRequest, callbackQueue: callbackQueue, mapper: mapper) { result in - switch result { + callbackQueue.async { + switch result { - case .success(let decoded): - completion(.success(decoded)) - case .failure(let error): - completion(.failure(error)) + case .success(let decoded): + completion(.success(decoded)) + case .failure(let error): + completion(.failure(error)) + } } } case .failure(let error): diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 9c581b6f0..e72fc6aa8 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "2.3.0" + static let version = "2.3.1" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/"