From 5c636e74823a4925afea0101a37dabc79dea5c39 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 6 Feb 2023 15:19:30 +0800 Subject: [PATCH] Lookup highlight from store before syncing deletion changes so we have the latest copy in memory --- .../DataService/Mutations/DeleteHighlight.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift index a491ec1b8..98f5bf032 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/DeleteHighlight.swift @@ -59,14 +59,14 @@ public extension DataService { highlight.remove(inContext: context) } else { highlight.serverSyncStatus = Int64(ServerSyncStatus.needsDeletion.rawValue) + } - do { - try context.save() - logger.debug("Highlight deleted succesfully") - } catch { - context.rollback() - logger.debug("Failed to delete Highlight: \(error.localizedDescription)") - } + do { + try context.save() + logger.debug("Highlight deleted succesfully") + } catch { + context.rollback() + logger.debug("Failed to delete Highlight: \(error.localizedDescription)") } } }