Skip to content

Commit

Permalink
Merge branch 'main' into addOTP
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaker6 authored May 17, 2024
2 parents 711dc8a + 077d457 commit e9f9540
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 24 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ jobs:
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}

Expand Down Expand Up @@ -91,11 +92,12 @@ jobs:
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
env_vars: SPM
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}

Expand Down Expand Up @@ -126,28 +128,30 @@ jobs:
cat .codecov.yml | curl --data-binary @- https://codecov.io/validate
llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/debug/ParseSwiftPackageTests.xctest -instr-profile .build/x86_64-unknown-linux-gnu/debug/codecov/default.profdata > info_linux.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
env_vars: LINUX
fail_ci_if_error: true

fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

windows:
timeout-minutes: 15
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: compnerd/[email protected].1
- uses: compnerd/[email protected].2
with:
branch: swift-5.10-release
tag: 5.10-RELEASE
- name: Build
run: |
swift build -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
env_vars: WINDOWSLATEST
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

docs:
timeout-minutes: 10
Expand Down Expand Up @@ -176,4 +180,4 @@ jobs:
- name: CocoaPods
run: pod lib lint --allow-warnings
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_14 }}
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: set -o pipefail && env NSUnbufferedIO=YES pod trunk push ParseSwiftOG.podspec --allow-warnings --verbose
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
DEVELOPER_DIR: ${{ env.CI_XCODE_14 }}
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}

docs:
runs-on: macos-14
Expand Down
26 changes: 23 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@
# Parse-Swift Changelog

### main
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.3...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.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)

__Fixes__
* Certain calls to the user or installation did not wait for the SDK to initialize causing a crash ([#163](https://github.com/netreconlab/Parse-Swift/pull/163)), thanks to [Corey Baker](https://github.com/cbaker6).

### 5.9.2
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.1...5.9.2), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.9.2/documentation/parseswift)

__Fixes__
* Querying using findAll may be inacurrate when results are greater than the batch limit ([#161](https://github.com/netreconlab/Parse-Swift/pull/161)), thanks to [Corey Baker](https://github.com/cbaker6).

### 5.9.1
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.0...5.9.1), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.9.1/documentation/parseswift)

__Fixes__
* Build for visionOS properly ([#160](https://github.com/netreconlab/Parse-Swift/pull/160)), thanks to [Corey Baker](https://github.com/cbaker6).
* Cocoapods now defaults to Swift 5.10 ([#159](https://github.com/netreconlab/Parse-Swift/pull/159)), thanks to [Corey Baker](https://github.com/cbaker6).

### 5.9.0
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.8.2...5.9.0), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.9.0/documentation/parseswift)

Expand All @@ -14,8 +34,8 @@ __New features__
* Add fetchAll method to array of Parse Pointer Object's ([#141](https://github.com/netreconlab/Parse-Swift/pull/141)), thanks to [Corey Baker](https://github.com/cbaker6).

__Fixes__
* Improve mutiple types conformance to Equatable and Hashable ([#148](https://github.com/netreconlab/Parse-Swift/pull/147)), thanks to [Corey Baker](https://github.com/cbaker6).
* Updates to ParseUser password now persist the updated sessionToken from the server to the client Keychain ([#147](https://github.com/netreconlab/Parse-Swift/pull/148)), thanks to [Corey Baker](https://github.com/cbaker6).
* Improve mutiple types conformance to Equatable and Hashable ([#148](https://github.com/netreconlab/Parse-Swift/pull/148)), thanks to [Corey Baker](https://github.com/cbaker6).
* Updates to ParseUser password now persist the updated sessionToken from the server to the client Keychain ([#147](https://github.com/netreconlab/Parse-Swift/pull/147)), thanks to [Corey Baker](https://github.com/cbaker6).

### 5.8.2
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.8.1...5.8.2), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.8.2/documentation/parseswift)
Expand Down
10 changes: 6 additions & 4 deletions ParseSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,7 @@
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 6.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2007,6 +2008,7 @@
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 6.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
Expand Down Expand Up @@ -2034,7 +2036,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
PRODUCT_NAME = ParseSwift;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
Expand Down Expand Up @@ -2069,7 +2071,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
PRODUCT_NAME = ParseSwift;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
Expand Down Expand Up @@ -2100,7 +2102,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xrsimulator xros";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -2129,7 +2131,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xrsimulator xros";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion ParseSwiftOG.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = "10.15"
s.tvos.deployment_target = "13.0"
s.watchos.deployment_target = "6.0"
s.swift_versions = ['5.5', '5.6', '5.7', '5.8', '5.9']
s.swift_versions = ['5.5', '5.6', '5.7', '5.8', '5.9', '5.10']
s.source_files = "Sources/ParseSwift/**/*.swift"
s.license = {
:type => "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion ParseSwiftOG.podtemplate
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = "10.15"
s.tvos.deployment_target = "13.0"
s.watchos.deployment_target = "6.0"
s.swift_versions = ['5.5', '5.6', '5.7', '5.8', '5.9']
s.swift_versions = ['5.5', '5.6', '5.7', '5.8', '5.9', '5.10']
s.source_files = "Sources/ParseSwift/**/*.swift"
s.license = {
:type => "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion Scripts/generate-documentation
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ cd "$PROJECT_ROOT"
mkdir "$TEMP_WORKSPACE_DIR"
mv Parse.xcworkspace "$TEMP_WORKSPACE_DIR/Parse.xcworkspace"

xcodebuild clean build -scheme ParseSwift\ \(iOS\) \
xcodebuild clean build -scheme ParseSwift \
-destination generic/platform=iOS \
OTHER_SWIFT_FLAGS="-emit-symbol-graph -emit-symbol-graph-dir '$SGFS_DIR'" | xcpretty

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ public extension ParseUser {
}

internal func linkCommand(body: SignupLoginBody) async throws -> API.Command<SignupLoginBody, Self> {
try await yieldIfNotInitialized()
let currentStrippedUser = try await self.anonymous.strip()
var body = body
if var currentAuthData = currentStrippedUser.authData {
Expand Down
21 changes: 18 additions & 3 deletions Sources/ParseSwift/Objects/ParseInstallation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,25 @@ public extension ParseInstallation {
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
desires a different policy, it should be inserted in `options`.
*/
static func deleteObjCKeychain(options: API.Options = [],
callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<Void, ParseError>) -> Void) {
static func deleteObjCKeychain( // swiftlint:disable:this function_body_length
options: API.Options = [],
callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<Void, ParseError>) -> Void
) {
Task {
do {
try await yieldIfNotInitialized()
} catch {
let defaultError = ParseError(
code: .otherCause,
swift: error
)
let parseError = error as? ParseError ?? defaultError
callbackQueue.async {
completion(.failure(parseError))
}
return
}
guard let objcParseKeychain = KeychainStore.objectiveC,
// swiftlint:disable:next line_length
let oldInstallationId: String = await objcParseKeychain.objectObjectiveC(forKey: "installationId") else {
Expand Down
14 changes: 14 additions & 0 deletions Sources/ParseSwift/Objects/ParseUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public extension ParseUser {
}

internal static func setCurrent(_ newValue: Self?) async throws {
try await yieldIfNotInitialized()
var currentContainer = await Self.currentContainer()
if let newValue = newValue,
let currentUser = currentContainer?.currentUser {
Expand Down Expand Up @@ -438,6 +439,19 @@ extension ParseUser {
callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<Self, ParseError>) -> Void) {
Task {
do {
try await yieldIfNotInitialized()
} catch {
let defaultError = ParseError(
code: .otherCause,
swift: error
)
let parseError = error as? ParseError ?? defaultError
callbackQueue.async {
completion(.failure(parseError))
}
return
}
let objcParseKeychain = KeychainStore.objectiveC
// swiftlint:disable:next line_length
guard let objcParseUser: [String: String] = await objcParseKeychain?.objectObjectiveC(forKey: "currentUser"),
Expand Down
4 changes: 3 additions & 1 deletion Sources/ParseSwift/ParseConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

enum ParseConstants {
static let sdk = "swift"
static let version = "5.9.0"
static let version = "5.9.3"
static let fileManagementDirectory = "parse/"
static let fileManagementPrivateDocumentsDirectory = "Private Documents/"
static let fileManagementLibraryDirectory = "Library/"
Expand All @@ -26,6 +26,8 @@ enum ParseConstants {
static let deviceType = "tvos"
#elseif os(watchOS)
static let deviceType = "applewatch"
#elseif os(visionOS)
static let deviceType = "visionos"
#elseif os(Linux)
static let deviceType = "linux"
#elseif os(Android)
Expand Down
4 changes: 3 additions & 1 deletion Sources/ParseSwift/Types/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ extension Query: Queryable {
var query = self
.order([.ascending("objectId")])
query.limit = limit ?? ParseConstants.batchLimit
let originalQueryWhere = query.where
var results = [ResultType]()
var finished = false
while !finished {
Expand All @@ -593,8 +594,9 @@ extension Query: Queryable {
results.append(contentsOf: currentResults)
if currentResults.count >= query.limit {
guard let lastObjectId = results[results.count - 1].objectId else {
throw ParseError(code: .otherCause, message: "Last object should have an id.")
throw ParseError(code: .otherCause, message: "Last object should have an objectId.")
}
query.where = originalQueryWhere
query.where.add("objectId" > lastObjectId)
} else {
finished = true
Expand Down

0 comments on commit e9f9540

Please sign in to comment.