@@ -354,9 +354,13 @@ extension ParseInstallation {
354
354
- parameter options: A set of header options sent to the server. Defaults to an empty set.
355
355
- throws: An error of `ParseError` type.
356
356
- important: If an object fetched has the same objectId as current, it will automatically update the current.
357
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
358
+ desires a different policy, it should be inserted in `options`.
357
359
*/
358
360
public func fetch( includeKeys: [ String ] ? = nil ,
359
361
options: API . Options = [ ] ) throws -> Self {
362
+ var options = options
363
+ options. insert ( . cachePolicy( . reloadIgnoringLocalCacheData) )
360
364
let result : Self = try fetchCommand ( include: includeKeys)
361
365
. execute ( options: options, callbackQueue: . main)
362
366
try Self . updateKeychainIfNeeded ( [ result] )
@@ -374,13 +378,17 @@ extension ParseInstallation {
374
378
- parameter completion: The block to execute when completed.
375
379
It should have the following argument signature: `(Result<Self, ParseError>)`.
376
380
- important: If an object fetched has the same objectId as current, it will automatically update the current.
381
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
382
+ desires a different policy, it should be inserted in `options`.
377
383
*/
378
384
public func fetch(
379
385
includeKeys: [ String ] ? = nil ,
380
386
options: API . Options = [ ] ,
381
387
callbackQueue: DispatchQueue = . main,
382
388
completion: @escaping ( Result < Self , ParseError > ) -> Void
383
389
) {
390
+ var options = options
391
+ options. insert ( . cachePolicy( . reloadIgnoringLocalCacheData) )
384
392
do {
385
393
try fetchCommand ( include: includeKeys)
386
394
. executeAsync ( options: options,
@@ -469,6 +477,8 @@ extension ParseInstallation {
469
477
increase the probability of colliding `objectId`'s as the client and server `objectId`'s may be generated using
470
478
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
471
479
client-side checks are disabled. Developers are responsible for handling such cases.
480
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
481
+ desires a different policy, it should be inserted in `options`.
472
482
*/
473
483
public func save( isIgnoreCustomObjectIdConfig: Bool ,
474
484
options: API . Options = [ ] ) throws -> Self {
@@ -520,6 +530,8 @@ extension ParseInstallation {
520
530
increase the probability of colliding `objectId`'s as the client and server `objectId`'s may be generated using
521
531
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
522
532
client-side checks are disabled. Developers are responsible for handling such cases.
533
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
534
+ desires a different policy, it should be inserted in `options`.
523
535
*/
524
536
public func save(
525
537
isIgnoreCustomObjectIdConfig: Bool = false ,
@@ -615,6 +627,8 @@ extension ParseInstallation {
615
627
- parameter options: A set of header options sent to the server. Defaults to an empty set.
616
628
- throws: An error of `ParseError` type.
617
629
- important: If an object deleted has the same objectId as current, it will automatically update the current.
630
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
631
+ desires a different policy, it should be inserted in `options`.
618
632
*/
619
633
public func delete( options: API . Options = [ ] ) throws {
620
634
var options = options
@@ -632,6 +646,8 @@ extension ParseInstallation {
632
646
- parameter completion: The block to execute when completed.
633
647
It should have the following argument signature: `(Result<Void, ParseError>)`.
634
648
- important: If an object deleted has the same objectId as current, it will automatically update the current.
649
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
650
+ desires a different policy, it should be inserted in `options`.
635
651
*/
636
652
public func delete(
637
653
options: API . Options = [ ] ,
@@ -724,6 +740,8 @@ public extension Sequence where Element: ParseInstallation {
724
740
increase the probability of colliding `objectId`'s as the client and server `objectId`'s may be generated using
725
741
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
726
742
client-side checks are disabled. Developers are responsible for handling such cases.
743
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
744
+ desires a different policy, it should be inserted in `options`.
727
745
*/
728
746
func saveAll( batchLimit limit: Int ? = nil , // swiftlint:disable:this function_body_length
729
747
transaction: Bool = false ,
@@ -825,6 +843,8 @@ public extension Sequence where Element: ParseInstallation {
825
843
increase the probability of colliding `objectId`'s as the client and server `objectId`'s may be generated using
826
844
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
827
845
client-side checks are disabled. Developers are responsible for handling such cases.
846
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
847
+ desires a different policy, it should be inserted in `options`.
828
848
*/
829
849
func saveAll( // swiftlint:disable:this function_body_length cyclomatic_complexity
830
850
batchLimit limit: Int ? = nil ,
@@ -1067,6 +1087,8 @@ public extension Sequence where Element: ParseInstallation {
1067
1087
- warning: If `transaction = true`, then `batchLimit` will be automatically be set to the amount of the
1068
1088
objects in the transaction. The developer should ensure their respective Parse Servers can handle the limit or else
1069
1089
the transactions can fail.
1090
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
1091
+ desires a different policy, it should be inserted in `options`.
1070
1092
*/
1071
1093
func deleteAll( batchLimit limit: Int ? = nil ,
1072
1094
transaction: Bool = false ,
@@ -1117,6 +1139,8 @@ public extension Sequence where Element: ParseInstallation {
1117
1139
- warning: If `transaction = true`, then `batchLimit` will be automatically be set to the amount of the
1118
1140
objects in the transaction. The developer should ensure their respective Parse Servers can handle the limit or else
1119
1141
the transactions can fail.
1142
+ - note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
1143
+ desires a different policy, it should be inserted in `options`.
1120
1144
*/
1121
1145
func deleteAll(
1122
1146
batchLimit limit: Int ? = nil ,
0 commit comments