Skip to content

Commit 835083e

Browse files
authored
fix: hydrateUser() should not replace the options passed in (#121)
1 parent df20af5 commit 835083e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
# Parse-Swift Changelog
33

44
### main
5-
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.7.3...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
5+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.7.4...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
66
* _Contributing to this repo? Add info about your change here to be included in the next release_
77

8+
### 5.7.4
9+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.7.3...5.7.4), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.7.4/documentation/parseswift)
10+
11+
__Fixes__
12+
* hydrateUser() should not replace the options passed in ([#121](https://github.com/netreconlab/Parse-Swift/pull/121)), thanks to [Corey Baker](https://github.com/cbaker6).
13+
814
### 5.7.3
915
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.7.2...5.7.3), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.7.3/documentation/parseswift)
1016

Sources/ParseSwift/ParseConstants.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
enum ParseConstants {
1212
static let sdk = "swift"
13-
static let version = "5.7.3"
13+
static let version = "5.7.4"
1414
static let fileManagementDirectory = "parse/"
1515
static let fileManagementPrivateDocumentsDirectory = "Private Documents/"
1616
static let fileManagementLibraryDirectory = "Library/"

Sources/ParseSwift/Protocols/ParseHookRequestable.swift

+5-6
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ extension ParseHookRequestable {
5252
if let primaryKey = primaryKey,
5353
primaryKey {
5454
options.insert(.usePrimaryKey)
55-
} else if let sessionToken = user?.sessionToken {
56-
options.insert(.sessionToken(sessionToken))
55+
} else {
56+
if let sessionToken = user?.sessionToken {
57+
options.insert(.sessionToken(sessionToken))
58+
}
5759
if let installationId = installationId {
5860
options.insert(.installationId(installationId))
5961
}
60-
} else if let installationId = installationId {
61-
options.insert(.installationId(installationId))
6262
}
6363
return options
6464
}
@@ -83,8 +83,7 @@ extension ParseHookRequestable {
8383
}
8484
let request = self
8585
var updatedOptions = self.options()
86-
updatedOptions.insert(.cachePolicy(.reloadIgnoringLocalCacheData))
87-
options.forEach { updatedOptions.insert($0) }
86+
updatedOptions = options.union(updatedOptions)
8887
user.fetch(options: updatedOptions,
8988
callbackQueue: callbackQueue) { result in
9089
switch result {

0 commit comments

Comments
 (0)