Merge branch 'feature/sync-reliability'
This commit is contained in:
@@ -169,13 +169,19 @@ struct BootstrappedContentView: View {
|
||||
await StoreManager.shared.loadProducts()
|
||||
await StoreManager.shared.updateEntitlements()
|
||||
|
||||
// 6. App is now usable
|
||||
// 6. Start network monitoring and wire up sync callback
|
||||
NetworkMonitor.shared.onSyncNeeded = {
|
||||
await BackgroundSyncManager.shared.triggerSyncFromNetworkRestoration()
|
||||
}
|
||||
NetworkMonitor.shared.startMonitoring()
|
||||
|
||||
// 7. App is now usable
|
||||
isBootstrapping = false
|
||||
|
||||
// 7. Schedule background tasks for future syncs
|
||||
// 8. Schedule background tasks for future syncs
|
||||
BackgroundSyncManager.shared.scheduleAllTasks()
|
||||
|
||||
// 8. Background: Try to refresh from CloudKit (non-blocking)
|
||||
// 9. Background: Try to refresh from CloudKit (non-blocking)
|
||||
Task.detached(priority: .background) {
|
||||
await self.performBackgroundSync(context: context)
|
||||
await MainActor.run {
|
||||
|
||||
Reference in New Issue
Block a user