diff --git a/Tusker/CoreData/MastodonCachePersistentStore.swift b/Tusker/CoreData/MastodonCachePersistentStore.swift index b055d119..44fd8bc9 100644 --- a/Tusker/CoreData/MastodonCachePersistentStore.swift +++ b/Tusker/CoreData/MastodonCachePersistentStore.swift @@ -545,20 +545,12 @@ class MastodonCachePersistentStore: NSPersistentCloudKitContainer { } if !transactions.isEmpty { self.processPersistentHistoryTransactions(transactions) - - do { - // delete history only before the last token, because we don't want to invalidate - // the most recent token - let deleteReq = NSPersistentHistoryChangeRequest.deleteHistory(before: lastToken) - let result = try self.remoteChangesBackgroundContext.execute(deleteReq) - if let result = result as? NSPersistentHistoryResult, - result.resultType == .statusOnly { - logger.info("Delete old persistent history result status: \(result.result as! Int)") - } - } catch { - logger.error("Unable to delete old persistent history: \(String(describing: error), privacy: .public)") - } } + + // NB: We deliberately do not purge old persistent history. + // Doing so causes the CoreData+CloudKit integration to replay all of + // the server's changes on initialization, which takes a long time + // and produces a bunch of intermediate UI updates we don't want. } } }