From 10ec67c29050cc7e9d69bc59dda787ec5a145e75 Mon Sep 17 00:00:00 2001 From: Corey Date: Wed, 10 Jul 2024 19:02:08 -0700 Subject: [PATCH] feat: Mark ParseObject and related types as Sendable (#174) * feat: Mark ParseObject and related types as Sendable * more Sendable * Update CHANGELOG.md * More Sendable --- CHANGELOG.md | 8 +++++++- ParseSwift.xcodeproj/project.pbxproj | 6 ++++++ Sources/ParseSwift/API/API+Command.swift | 17 +++++++++-------- Sources/ParseSwift/API/API.swift | 8 ++++---- Sources/ParseSwift/API/BatchUtils.swift | 2 +- .../Protocols/ParseAuthentication.swift | 19 ++++++++++--------- .../ParseSwift/Extensions/InputStream.swift | 11 +++++++++++ .../Objects/ParseInstallation.swift | 9 +++++---- Sources/ParseSwift/Objects/ParseUser.swift | 9 +++++---- Sources/ParseSwift/ParseConstants.swift | 4 ++-- .../ParseSwift/Protocols/ParseEncodable.swift | 2 +- .../Protocols/ParseHookFunctionable.swift | 2 +- .../Protocols/ParseHookParametable.swift | 2 +- .../Protocols/ParseHookTriggerable.swift | 2 +- .../ParseSwift/Protocols/ParseTypeable.swift | 1 + .../Operations/ParseOperationCommand.swift | 2 +- Sources/ParseSwift/Types/ParseACL.swift | 2 +- Sources/ParseSwift/Types/ParseField.swift | 2 +- .../ParseSwift/Types/ParseHookResponse.swift | 2 +- .../Apple/ParsePushPayloadApple.swift | 2 +- .../Firebase/ParsePushPayloadFirebase.swift | 2 +- Sources/ParseSwift/Types/Query.swift | 2 +- 22 files changed, 72 insertions(+), 44 deletions(-) create mode 100644 Sources/ParseSwift/Extensions/InputStream.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 299cdc265..e52d7c673 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,16 @@ # Parse-Swift Changelog ### main -[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.3...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.10.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 5.10.0 +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.3...5.10.0), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.10.0/documentation/parseswift) + +__New features__ +* Make many of the Parse protocols and types conform to Sendable ([#174](https://github.com/netreconlab/Parse-Swift/pull/174)), thanks to [Corey Baker](https://github.com/cbaker6). + ### 5.9.3 [Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.2...5.9.3), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.9.3/documentation/parseswift) diff --git a/ParseSwift.xcodeproj/project.pbxproj b/ParseSwift.xcodeproj/project.pbxproj index 3757becd6..4ba8a3933 100644 --- a/ParseSwift.xcodeproj/project.pbxproj +++ b/ParseSwift.xcodeproj/project.pbxproj @@ -142,6 +142,7 @@ 707A3BF125B0A4F0000D215C /* ParseAuthentication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707A3BF025B0A4F0000D215C /* ParseAuthentication.swift */; }; 707A3C1125B0A8E8000D215C /* ParseAnonymous.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707A3C1025B0A8E8000D215C /* ParseAnonymous.swift */; }; 707A3C2025B14BD0000D215C /* ParseApple.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707A3C1F25B14BCF000D215C /* ParseApple.swift */; }; + 707DC1C02C3F5DE900FC1DFD /* InputStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707DC1BF2C3F5DE900FC1DFD /* InputStream.swift */; }; 7085DD9426CBF3A70033B977 /* Documentation.docc in Sources */ = {isa = PBXBuildFile; fileRef = 7085DD9326CBF3A70033B977 /* Documentation.docc */; }; 7085DDA326CC8A470033B977 /* ParseServer+combine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7085DDA226CC8A470033B977 /* ParseServer+combine.swift */; }; 7085DDB326D1EC7F0033B977 /* ParseAuthenticationCombineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7085DDB226D1EC7F0033B977 /* ParseAuthenticationCombineTests.swift */; }; @@ -489,6 +490,7 @@ 707A3BF025B0A4F0000D215C /* ParseAuthentication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseAuthentication.swift; sourceTree = ""; }; 707A3C1025B0A8E8000D215C /* ParseAnonymous.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseAnonymous.swift; sourceTree = ""; }; 707A3C1F25B14BCF000D215C /* ParseApple.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseApple.swift; sourceTree = ""; }; + 707DC1BF2C3F5DE900FC1DFD /* InputStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputStream.swift; sourceTree = ""; }; 7085DD9326CBF3A70033B977 /* Documentation.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = Documentation.docc; sourceTree = ""; }; 7085DDA226CC8A470033B977 /* ParseServer+combine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ParseServer+combine.swift"; sourceTree = ""; }; 7085DDB226D1EC7F0033B977 /* ParseAuthenticationCombineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseAuthenticationCombineTests.swift; sourceTree = ""; }; @@ -1084,6 +1086,7 @@ 706436A827341FD0007C6461 /* Date.swift */, 70C048C02880D7E500401689 /* Dictionary.swift */, 706436A327341F6E007C6461 /* Encodable.swift */, + 707DC1BF2C3F5DE900FC1DFD /* InputStream.swift */, 9116F66E26A35D600082F6D6 /* URLCache.swift */, F97B462C24D9C74400F4A88B /* URLSession.swift */, ); @@ -1602,6 +1605,7 @@ 916E207029D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */, 70B4E0BC2762F1D5004C9757 /* QueryConstraint.swift in Sources */, 70C167B427304F09009F4E30 /* Pointer+async.swift in Sources */, + 707DC1C02C3F5DE900FC1DFD /* InputStream.swift in Sources */, 705025AE28456106008D6624 /* ParsePushStatusable.swift in Sources */, F97B464A24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */, 705025CC284CE4C2008D6624 /* ParsePushPayloadable.swift in Sources */, @@ -1918,6 +1922,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_STRICT_CONCURRENCY = minimal; SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 13.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1982,6 +1987,7 @@ SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_STRICT_CONCURRENCY = minimal; SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 13.0; VALIDATE_PRODUCT = YES; diff --git a/Sources/ParseSwift/API/API+Command.swift b/Sources/ParseSwift/API/API+Command.swift index 8969a3dfa..e65003857 100644 --- a/Sources/ParseSwift/API/API+Command.swift +++ b/Sources/ParseSwift/API/API+Command.swift @@ -14,12 +14,12 @@ import FoundationNetworking internal extension API { // MARK: API.Command // swiftlint:disable:next type_body_length - struct Command: Encodable where T: ParseEncodable { + struct Command: Encodable, Sendable where T: ParseEncodable, U: Sendable { typealias ReturnType = U // swiftlint:disable:this nesting let method: API.Method let path: API.Endpoint let body: T? - let mapper: ((Data) async throws -> U) + let mapper: (@Sendable (Data) async throws -> U) let params: [String: String?]? let uploadData: Data? let uploadFile: URL? @@ -36,7 +36,7 @@ internal extension API { parseURL: URL? = nil, otherURL: URL? = nil, stream: InputStream? = nil, - mapper: @escaping ((Data) async throws -> U)) { + mapper: @escaping (@Sendable (Data) async throws -> U)) { self.method = method self.path = path self.body = body @@ -429,8 +429,9 @@ internal extension API.Command { let acl = try? await ParseACL.defaultACL() { object.ACL = acl } - let mapper = { (data) -> V in - try ParseCoding.jsonDecoder().decode(CreateResponse.self, from: data).apply(to: object) + let updatedObject = object + let mapper = { @Sendable (data) -> V in + try ParseCoding.jsonDecoder().decode(CreateResponse.self, from: data).apply(to: updatedObject) } return API.Command(method: .POST, path: try await object.endpoint(.POST), @@ -444,7 +445,7 @@ internal extension API.Command { throw ParseError(code: .missingObjectId, message: "objectId must not be nil") } - let mapper = { (mapperData: Data) -> V in + let mapper = { @Sendable (mapperData: Data) -> V in var updatedObject = object updatedObject.originalData = nil updatedObject = try ParseCoding @@ -471,7 +472,7 @@ internal extension API.Command { throw ParseError(code: .missingObjectId, message: "objectId must not be nil") } - let mapper = { (mapperData: Data) -> V in + let mapper = { @Sendable (mapperData: Data) -> V in var updatedObject = object updatedObject.originalData = nil updatedObject = try ParseCoding @@ -530,7 +531,7 @@ internal extension API.Command where T: ParseObject { mapper: command.mapper) } - let mapper = { (data: Data) -> [Result] in + let mapper = { @Sendable (data: Data) -> [Result] in let decodingType = [BatchResponseItem].self do { diff --git a/Sources/ParseSwift/API/API.swift b/Sources/ParseSwift/API/API.swift index 2ad84e035..82dc77665 100644 --- a/Sources/ParseSwift/API/API.swift +++ b/Sources/ParseSwift/API/API.swift @@ -16,11 +16,11 @@ import FoundationNetworking /// The REST API for communicating with a Parse Server. public struct API { - public enum Method: String, Encodable { + public enum Method: String, Encodable, Sendable { case GET, POST, PUT, PATCH, DELETE } - public enum Endpoint: Encodable { + public enum Endpoint: Encodable, Sendable { case batch case objects(className: String) case object(className: String, objectId: String) @@ -139,7 +139,7 @@ public struct API { public typealias Options = Set /// Options available to send to Parse Server. - public enum Option: Hashable { + public enum Option: Hashable, Sendable { /// Use the primaryKey/masterKey if it was provided during initial configuraration. case usePrimaryKey @@ -164,7 +164,7 @@ public struct API { case tags([String: String]) /// Add context. /// - warning: Requires Parse Server 5.0.0+. - case context(Encodable) + case context(Encodable & Sendable) /// The caching policy to use for a specific http request. Determines when to /// return a response from the cache. See Apple's /// [documentation](https://developer.apple.com/documentation/foundation/url_loading_system/accessing_cached_data) diff --git a/Sources/ParseSwift/API/BatchUtils.swift b/Sources/ParseSwift/API/BatchUtils.swift index 5386b94e4..be85b0e4c 100644 --- a/Sources/ParseSwift/API/BatchUtils.swift +++ b/Sources/ParseSwift/API/BatchUtils.swift @@ -23,7 +23,7 @@ typealias ParseObjectBatchResponseEncodablePointer = [(Result = API.NonParseBodyCommand, ParseObjectBatchResponseEncodablePointer> where T: Encodable // swiftlint:enable line_length -internal struct BatchCommand: ParseEncodable where T: ParseEncodable { +internal struct BatchCommand: ParseEncodable where T: ParseEncodable, U: Sendable { let requests: [API.Command] var transaction: Bool } diff --git a/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift b/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift index 698a3ad0f..6a54f7ab5 100644 --- a/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift +++ b/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift @@ -396,9 +396,9 @@ public extension ParseUser { } internal func linkCommand() async throws -> API.Command { - var mutableSelf = self.anonymous.strip(self) + let strippedUser = self.anonymous.strip(self) if let current = try? await Self.current() { - guard current.hasSameObjectId(as: mutableSelf) else { + guard current.hasSameObjectId(as: strippedUser) else { let error = ParseError(code: .otherCause, message: "Cannot signup a user with a different objectId than the current user") throw error @@ -406,16 +406,16 @@ public extension ParseUser { } return API.Command(method: .PUT, path: endpoint, - body: mutableSelf) { (data) -> Self in + body: strippedUser) { (data) -> Self in let user = try ParseCoding.jsonDecoder().decode(UpdateResponse.self, from: data) - mutableSelf = user.apply(to: mutableSelf) + let updatedUser = user.apply(to: strippedUser) if let sessionToken = user.sessionToken { - await Self.setCurrentContainer(.init(currentUser: mutableSelf, + await Self.setCurrentContainer(.init(currentUser: updatedUser, sessionToken: sessionToken)) } else { - try await Self.setCurrent(mutableSelf) + try await Self.setCurrent(updatedUser) } - return mutableSelf + return updatedUser } } @@ -431,13 +431,14 @@ public extension ParseUser { } body.authData = currentAuthData } + let updatedBody = body return API.Command(method: .PUT, path: endpoint, - body: body) { (data) -> Self in + body: updatedBody) { (data) -> Self in let user = try ParseCoding.jsonDecoder().decode(UpdateResponse.self, from: data) var currentUser = user.apply(to: currentStrippedUser) - currentUser.authData = body.authData + currentUser.authData = updatedBody.authData if let sessionToken = user.sessionToken { await Self.setCurrentContainer(.init(currentUser: currentUser, sessionToken: sessionToken)) diff --git a/Sources/ParseSwift/Extensions/InputStream.swift b/Sources/ParseSwift/Extensions/InputStream.swift new file mode 100644 index 000000000..7d093f887 --- /dev/null +++ b/Sources/ParseSwift/Extensions/InputStream.swift @@ -0,0 +1,11 @@ +// +// InputStream.swift +// ParseSwift +// +// Created by Corey Baker on 7/10/24. +// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +extension InputStream: @unchecked Sendable {} diff --git a/Sources/ParseSwift/Objects/ParseInstallation.swift b/Sources/ParseSwift/Objects/ParseInstallation.swift index 25a71f4cd..b9ea64e7b 100644 --- a/Sources/ParseSwift/Objects/ParseInstallation.swift +++ b/Sources/ParseSwift/Objects/ParseInstallation.swift @@ -747,8 +747,9 @@ extension ParseInstallation { let acl = try? await ParseACL.defaultACL() { object.ACL = acl } - let mapper = { (data) -> Self in - try ParseCoding.jsonDecoder().decode(CreateResponse.self, from: data).apply(to: object) + let updatedObject = object + let mapper = { @Sendable (data) -> Self in + try ParseCoding.jsonDecoder().decode(CreateResponse.self, from: data).apply(to: updatedObject) } return API.Command(method: .POST, path: try await endpoint(.POST), @@ -761,7 +762,7 @@ extension ParseInstallation { throw ParseError(code: .missingObjectId, message: "objectId must not be nil") } - let mapper = { (data: Data) -> Self in + let mapper = { @Sendable (data: Data) -> Self in var updatedObject = self updatedObject.originalData = nil updatedObject = try ParseCoding.jsonDecoder().decode(ReplaceResponse.self, @@ -786,7 +787,7 @@ extension ParseInstallation { throw ParseError(code: .missingObjectId, message: "objectId must not be nil") } - let mapper = { (data: Data) -> Self in + let mapper = { @Sendable (data: Data) -> Self in var updatedObject = self updatedObject.originalData = nil updatedObject = try ParseCoding.jsonDecoder().decode(UpdateResponse.self, diff --git a/Sources/ParseSwift/Objects/ParseUser.swift b/Sources/ParseSwift/Objects/ParseUser.swift index 882341fcd..da93eef00 100644 --- a/Sources/ParseSwift/Objects/ParseUser.swift +++ b/Sources/ParseSwift/Objects/ParseUser.swift @@ -1216,13 +1216,14 @@ extension ParseUser { let acl = try? await ParseACL.defaultACL() { user.ACL = acl } - let mapper = { (data) -> Self in + let updatedUser = user + let mapper = { @Sendable (data) -> Self in try ParseCoding .jsonDecoder() .decode( CreateResponse.self, from: data - ).apply(to: user) + ).apply(to: updatedUser) } let path = try await endpoint(.POST) let command = API.Command( @@ -1246,7 +1247,7 @@ extension ParseUser { mutableSelf.email = nil } } - let mapper = { (data: Data) -> Self in + let mapper = { @Sendable (data: Data) -> Self in var updatedUser = self updatedUser.originalData = nil let userResponse = try ParseCoding @@ -1301,7 +1302,7 @@ extension ParseUser { mutableSelf.email = nil } } - let mapper = { (data: Data) -> Self in + let mapper = { @Sendable (data: Data) -> Self in var updatedUser = self updatedUser.originalData = nil let userResponse = try ParseCoding diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 151ecf411..2742007c6 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 = "5.9.3" + static let version = "5.10.0" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" @@ -44,7 +44,7 @@ enum Method: String { /** The types of Parse Hook Triggers available. */ -public enum ParseHookTriggerType: String, Codable { +public enum ParseHookTriggerType: String, Codable, Sendable { /// Occurs before login of a `ParseUser`. case beforeLogin /// Occurs after login of a `ParseUser`. diff --git a/Sources/ParseSwift/Protocols/ParseEncodable.swift b/Sources/ParseSwift/Protocols/ParseEncodable.swift index 87dbb05b7..294776e18 100644 --- a/Sources/ParseSwift/Protocols/ParseEncodable.swift +++ b/Sources/ParseSwift/Protocols/ParseEncodable.swift @@ -12,7 +12,7 @@ import Foundation Types that conform to **ParseEncodable** should be encoded by the `ParseEncoder` when necessary. */ -public protocol ParseEncodable: Encodable {} +public protocol ParseEncodable: Encodable, Sendable {} // MARK: CustomDebugStringConvertible extension ParseEncodable { diff --git a/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift b/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift index 8dda7fd96..582117d6b 100644 --- a/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift +++ b/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift @@ -37,7 +37,7 @@ public extension ParseHookFunctionable { } /// A type of request for Parse Hook Functions. -public struct FunctionRequest: Encodable { +public struct FunctionRequest: Encodable, Sendable { let functionName: String let url: URL? diff --git a/Sources/ParseSwift/Protocols/ParseHookParametable.swift b/Sources/ParseSwift/Protocols/ParseHookParametable.swift index 6690c6adf..4bb8c146b 100644 --- a/Sources/ParseSwift/Protocols/ParseHookParametable.swift +++ b/Sources/ParseSwift/Protocols/ParseHookParametable.swift @@ -12,4 +12,4 @@ import Foundation Conforming to `ParseHookParametable` allows types that can be created to decode parameters in `ParseHookFunctionRequest`'s. */ -public protocol ParseHookParametable: Codable, Equatable {} +public protocol ParseHookParametable: Codable, Equatable, Sendable {} diff --git a/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift b/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift index 0d00d160a..ae647f938 100644 --- a/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift +++ b/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift @@ -113,7 +113,7 @@ public extension ParseHookTriggerable { } /// A type of request for Parse Hook Triggers. -public struct TriggerRequest: Encodable { +public struct TriggerRequest: Encodable, Sendable { let className: String let trigger: ParseHookTriggerType let url: URL? diff --git a/Sources/ParseSwift/Protocols/ParseTypeable.swift b/Sources/ParseSwift/Protocols/ParseTypeable.swift index 555049652..31e3df094 100644 --- a/Sources/ParseSwift/Protocols/ParseTypeable.swift +++ b/Sources/ParseSwift/Protocols/ParseTypeable.swift @@ -12,6 +12,7 @@ import Foundation A special type that is considered a Parse type. */ public protocol ParseTypeable: Codable, + Sendable, Equatable, CustomDebugStringConvertible, CustomStringConvertible {} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift b/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift index 86026a60a..01ea85941 100644 --- a/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift +++ b/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift @@ -9,7 +9,7 @@ import Foundation /// Represents all supported Parse operation commands. -public enum ParseOperationCommand: String, Codable { +public enum ParseOperationCommand: String, Codable, Sendable { /// The add command. case add = "Add" /// The add relation command. diff --git a/Sources/ParseSwift/Types/ParseACL.swift b/Sources/ParseSwift/Types/ParseACL.swift index ae54b61d4..a401c4b42 100644 --- a/Sources/ParseSwift/Types/ParseACL.swift +++ b/Sources/ParseSwift/Types/ParseACL.swift @@ -25,7 +25,7 @@ public struct ParseACL: ParseTypeable, /** An enum specifying read and write access controls. */ - public enum Access: String, Codable, CodingKey { + public enum Access: String, Codable, Sendable, CodingKey { /// Read access control. case read /// Write access control. diff --git a/Sources/ParseSwift/Types/ParseField.swift b/Sources/ParseSwift/Types/ParseField.swift index 93f45c37a..424e78934 100644 --- a/Sources/ParseSwift/Types/ParseField.swift +++ b/Sources/ParseSwift/Types/ParseField.swift @@ -17,7 +17,7 @@ public struct ParseField: ParseTypeable { var targetClass: String? /// Field types available in `ParseSchema`. - public enum FieldType: String, Codable { + public enum FieldType: String, Codable, Sendable { /// A string type. case string = "String" /// A number type. diff --git a/Sources/ParseSwift/Types/ParseHookResponse.swift b/Sources/ParseSwift/Types/ParseHookResponse.swift index 778da2e7c..8a9e52167 100644 --- a/Sources/ParseSwift/Types/ParseHookResponse.swift +++ b/Sources/ParseSwift/Types/ParseHookResponse.swift @@ -12,7 +12,7 @@ import Foundation Build a response after processing a `ParseHookFunctionRequest` or `ParseHookTriggerRequest`. */ -public struct ParseHookResponse: ParseTypeable { +public struct ParseHookResponse: ParseTypeable { /// The data to return in the response. public var success: R? /// An object with a Parse code and message. diff --git a/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift b/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift index 994e858bf..e058b7dc5 100644 --- a/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift +++ b/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift @@ -76,7 +76,7 @@ public struct ParsePushPayloadApple: ParsePushApplePayloadable { var sound: AnyCodable? /// The type of notification. - public enum PushType: String, Codable { + public enum PushType: String, Codable, Sendable { /// Send as an alert. case alert /// Send as a background notification. diff --git a/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift b/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift index 88e3bbc2b..c25f7c27b 100644 --- a/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift +++ b/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift @@ -46,7 +46,7 @@ public struct ParsePushPayloadFirebase: ParsePushFirebasePayloadable { public var notification: ParsePushFirebaseNotification? /// The priority type of a notification. - public enum PushPriority: String, Codable { + public enum PushPriority: String, Codable, Sendable { /// Sets the priority to **5**. case normal /// Sets the priority to **10**. diff --git a/Sources/ParseSwift/Types/Query.swift b/Sources/ParseSwift/Types/Query.swift index 6c3754d26..677fc870c 100644 --- a/Sources/ParseSwift/Types/Query.swift +++ b/Sources/ParseSwift/Types/Query.swift @@ -132,7 +132,7 @@ public struct Query: ParseTypeable where T: ParseObject { - parameter key: The key to order by. */ - public enum Order: Codable, Equatable { + public enum Order: Codable, Equatable, Sendable { /// Sort in ascending order based on `key`. case ascending(String) /// Sort in descending order based on `key`.