apple / apple/sample-cloudkit-sync-engine

Creating a zone on first launch

Open
#13 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
270
Forks
15
PR merge metrics
No merged PRs in 30d

Description

The sample app creates a custom zone when the accountChange event is triggered or if a .zoneNotFound error occurs while sending records. This naturally leads to .zoneNotFound errors on the first upload(s) until it fixes itself.

Is there a specific reason it's done this way? Would it be possible to call
`self.syncEngine.state.add(pendingDatabaseChanges: [ .saveZone(CKRecordZone(zoneName: Self.zone.zoneID.zoneName)) ])
`at app launch and have it finish before any other sync operations can occur?

Or is the approach in this sample project the recommended way and you just have to live with those error occurring once. This makes it especially hard to use the Telemetry Error feature in the CloudKit dashboard because you can never be sure if those errors are genuine.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.