@@ -515,21 +515,22 @@ public class ParseRemote: OCKRemoteSynchronizable {
515
515
localClock: OCKRevisionRecord . KnowledgeVector ,
516
516
completion: @escaping ( Error ? ) -> Void ) {
517
517
Task {
518
- var cloudVector = cloudVector
518
+ var updatedCloudVector = cloudVector
519
519
if shouldIncrementCloudClock {
520
520
// Increment and merge Knowledge Vector
521
- cloudVector . increment ( clockFor: self . uuid)
521
+ updatedCloudVector . increment ( clockFor: self . uuid)
522
522
}
523
- cloudVector . merge ( with: localClock)
523
+ updatedCloudVector . merge ( with: localClock)
524
524
525
- guard let updatedClock = PCKClock . encodeVector ( cloudVector , for: parseClock) else {
525
+ guard let updatedClock = PCKClock . encodeVector ( updatedCloudVector , for: parseClock) else {
526
526
await self . remoteStatus. setNotSynchronzing ( )
527
527
completion ( ParseCareKitError . couldntUnwrapClock)
528
528
return
529
529
}
530
530
531
531
// If clocks incremented or new clock introduced, no need to save to Cloud.
532
- guard shouldIncrementCloudClock || ( !shouldIncrementCloudClock && cloudVector. uuids. count != localClock. uuids. count) else {
532
+ guard shouldIncrementCloudClock ||
533
+ ( !shouldIncrementCloudClock && cloudVector. uuids. count != updatedCloudVector. uuids. count) else {
533
534
await self . remoteStatus. setNotSynchronzing ( )
534
535
// Clocks not updated, no need to update cloud.
535
536
if #available( iOS 14 . 0 , watchOS 7 . 0 , * ) {
0 commit comments