Actually don't purge old persistent history
This commit is contained in:
parent
d8fccc8f1b
commit
e6d9a33dbf
|
@ -545,20 +545,12 @@ class MastodonCachePersistentStore: NSPersistentCloudKitContainer {
|
||||||
}
|
}
|
||||||
if !transactions.isEmpty {
|
if !transactions.isEmpty {
|
||||||
self.processPersistentHistoryTransactions(transactions)
|
self.processPersistentHistoryTransactions(transactions)
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
// NB: We deliberately do not purge old persistent history.
|
||||||
// delete history only before the last token, because we don't want to invalidate
|
// Doing so causes the CoreData+CloudKit integration to replay all of
|
||||||
// the most recent token
|
// the server's changes on initialization, which takes a long time
|
||||||
let deleteReq = NSPersistentHistoryChangeRequest.deleteHistory(before: lastToken)
|
// and produces a bunch of intermediate UI updates we don't want.
|
||||||
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)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue