From 1ff1cf65041874fa0e4c01f51926a948662b8949 Mon Sep 17 00:00:00 2001 From: Corey Date: Sat, 22 Apr 2023 11:12:27 -0400 Subject: [PATCH] LiveQuery only responds to created revisions --- Sources/ParseCareKit/Models/PCKRevisionRecord.swift | 2 +- Sources/ParseCareKit/ParseRemote.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ParseCareKit/Models/PCKRevisionRecord.swift b/Sources/ParseCareKit/Models/PCKRevisionRecord.swift index c9925009c..c6ba26ffa 100644 --- a/Sources/ParseCareKit/Models/PCKRevisionRecord.swift +++ b/Sources/ParseCareKit/Models/PCKRevisionRecord.swift @@ -123,13 +123,13 @@ struct PCKRevisionRecord: ParseObject, Equatable, Codable { } func save(options: API.Options = []) async throws { - try await self.create(options: options) try await patients.createAll(options: options) try await carePlans.createAll(options: options) try await contacts.createAll(options: options) try await tasks.createAll(options: options) try await healthKitTasks.createAll(options: options) try await outcomes.createAll(options: options) + try await self.create(options: options) } func fetchEntities(options: API.Options = []) async throws -> Self { diff --git a/Sources/ParseCareKit/ParseRemote.swift b/Sources/ParseCareKit/ParseRemote.swift index 11c5d966f..c821049a4 100644 --- a/Sources/ParseCareKit/ParseRemote.swift +++ b/Sources/ParseCareKit/ParseRemote.swift @@ -197,7 +197,7 @@ public class ParseRemote: OCKRemoteSynchronizable { self.revisionRecordSubscription = try await self.revisionRecordQuery.subscribeCallback() self.revisionRecordSubscription?.handleEvent { (_, event) in switch event { - case .created(let updatedRevision), .entered(let updatedRevision), .updated(let updatedRevision): + case .created(let updatedRevision): guard let logicalClock = updatedRevision.logicalClock else { Logger .revisionRecordSubscription