Skip to content

Commit

Permalink
fix: hydrateUser() should not replace the options passed in (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaker6 committed Jun 22, 2023
1 parent df20af5 commit 835083e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
# Parse-Swift Changelog

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

__Fixes__
* 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).

### 5.7.3
[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)

Expand Down
2 changes: 1 addition & 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.7.3"
static let version = "5.7.4"
static let fileManagementDirectory = "parse/"
static let fileManagementPrivateDocumentsDirectory = "Private Documents/"
static let fileManagementLibraryDirectory = "Library/"
Expand Down
11 changes: 5 additions & 6 deletions Sources/ParseSwift/Protocols/ParseHookRequestable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ extension ParseHookRequestable {
if let primaryKey = primaryKey,
primaryKey {
options.insert(.usePrimaryKey)
} else if let sessionToken = user?.sessionToken {
options.insert(.sessionToken(sessionToken))
} else {
if let sessionToken = user?.sessionToken {
options.insert(.sessionToken(sessionToken))
}
if let installationId = installationId {
options.insert(.installationId(installationId))
}
} else if let installationId = installationId {
options.insert(.installationId(installationId))
}
return options
}
Expand All @@ -83,8 +83,7 @@ extension ParseHookRequestable {
}
let request = self
var updatedOptions = self.options()
updatedOptions.insert(.cachePolicy(.reloadIgnoringLocalCacheData))
options.forEach { updatedOptions.insert($0) }
updatedOptions = options.union(updatedOptions)
user.fetch(options: updatedOptions,
callbackQueue: callbackQueue) { result in
switch result {
Expand Down

0 comments on commit 835083e

Please sign in to comment.