mirror of
https://github.com/yattee/yattee.git
synced 2026-11-04 19:07:33 +00:00
Re-fetch everything from iCloud when the local store was recreated
On tvOS SwiftData keeps the store in the app group's Library/Caches, which the system may purge. The CKSyncEngine tokens live in UserDefaults and survive, so the next launch opened an empty store and fetched only records changed since the old tokens; subscriptions and bookmarks that had not changed since never came back. DataManager now records whether the store file existed when the container opened, and the sync engine clears its persisted state once per launch when it did not, so the first sync after a loss is a full fetch. Also log the store path and a persistent-store failure that previously fell back to in-memory storage silently.
This commit is contained in:
@@ -196,6 +196,7 @@ final class AppEnvironment {
|
||||
do {
|
||||
dm = try DataManager(iCloudSyncEnabled: settings.iCloudSyncEnabled)
|
||||
} catch {
|
||||
LoggingService.shared.logCloudKitError("Persistent store unavailable, falling back to in-memory storage", error: error)
|
||||
// Fall back to in-memory storage if persistent storage fails
|
||||
dm = try! DataManager(inMemory: true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user