Implement incremental iCloud sync

This commit is contained in:
Maurice Parker
2022-11-07 21:25:40 -06:00
parent 41869f7bd8
commit 97d740c41c
8 changed files with 13 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
import PackageDescription
var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .branch("main")),
.package(url: "https://github.com/Ranchero-Software/RSDatabase.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSParser.git", .upToNextMajor(from: "2.0.2")),
.package(url: "https://github.com/Ranchero-Software/RSWeb.git", .upToNextMajor(from: "1.0.0")),

View File

@@ -31,7 +31,7 @@ class CloudKitAcountZoneDelegate: CloudKitZoneDelegate {
self.articlesZone = articlesZone
}
func cloudKitDidModify(changed: [CKRecord], deleted: [CloudKitRecordKey], completion: @escaping (Result<Void, Error>) -> Void) {
func cloudKitWasChanged(updated: [CKRecord], deleted: [CloudKitRecordKey], completion: @escaping (Result<Void, Error>) -> Void) {
for deletedRecordKey in deleted {
switch deletedRecordKey.recordType {
case CloudKitAccountZone.CloudKitWebFeed.recordType:
@@ -43,7 +43,7 @@ class CloudKitAcountZoneDelegate: CloudKitZoneDelegate {
}
}
for changedRecord in changed {
for changedRecord in updated {
switch changedRecord.recordType {
case CloudKitAccountZone.CloudKitWebFeed.recordType:
addOrUpdateWebFeed(changedRecord)

View File

@@ -28,7 +28,7 @@ class CloudKitArticlesZoneDelegate: CloudKitZoneDelegate, Logging {
self.articlesZone = articlesZone
}
func cloudKitDidModify(changed: [CKRecord], deleted: [CloudKitRecordKey], completion: @escaping (Result<Void, Error>) -> Void) {
func cloudKitWasChanged(updated: [CKRecord], deleted: [CloudKitRecordKey], completion: @escaping (Result<Void, Error>) -> Void) {
database.selectPendingReadStatusArticleIDs() { result in
switch result {
@@ -39,7 +39,7 @@ class CloudKitArticlesZoneDelegate: CloudKitZoneDelegate, Logging {
case .success(let pendingStarredStatusArticleIDs):
self.delete(recordKeys: deleted, pendingStarredStatusArticleIDs: pendingStarredStatusArticleIDs) {
self.update(records: changed,
self.update(records: updated,
pendingReadStatusArticleIDs: pendingReadStatusArticleIDs,
pendingStarredStatusArticleIDs: pendingStarredStatusArticleIDs,
completion: completion)

View File

@@ -11,7 +11,7 @@ let package = Package(
targets: ["Articles"]),
],
dependencies: [
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .branch("main")),
],
targets: [
.target(

View File

@@ -4,7 +4,7 @@
import PackageDescription
var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .branch("main")),
.package(url: "https://github.com/Ranchero-Software/RSDatabase.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSParser.git", .upToNextMajor(from: "2.0.2")),
]

View File

@@ -4941,8 +4941,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Ranchero-Software/RSCore.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
branch = main;
kind = branch;
};
};
510ECA4024D1DCD0001C31A6 /* XCRemoteSwiftPackageReference "RSTree" */ = {

View File

@@ -59,9 +59,9 @@
"package": "RSCore",
"repositoryURL": "https://github.com/Ranchero-Software/RSCore.git",
"state": {
"branch": null,
"revision": "a2f711d64af8f1baefdf0092f57a7f0df7f0e5e8",
"version": "1.0.15"
"branch": "main",
"revision": "8a9c3e46449a9ea2c898aebcb37aad08ceeef7d9",
"version": null
}
},
{

View File

@@ -2,7 +2,7 @@
import PackageDescription
var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .branch("main")),
.package(url: "https://github.com/Ranchero-Software/RSDatabase.git", .upToNextMajor(from: "1.0.0")),
]