diff options
| author | Christian Cleberg <[email protected]> | 2026-07-24 18:17:09 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-24 18:32:24 -0500 |
| commit | 2ed92d773a2505ac3b6fbd3d280258549936ba2a (patch) | |
| tree | dd3dd8bb5a561f130920fd4986aa9c60b2ae6daf /DomainDigWidget/DomainDigPortfolioWidget.swift | |
| parent | 0aa8cdf3bb55f31039df1ce473dc23eca22b6449 (diff) | |
| download | domain-dig-2ed92d773a2505ac3b6fbd3d280258549936ba2a.tar.gz domain-dig-2ed92d773a2505ac3b6fbd3d280258549936ba2a.tar.bz2 domain-dig-2ed92d773a2505ac3b6fbd3d280258549936ba2a.zip | |
fix: sync CloudKit through a custom zone instead of queries (#29)
With the entitlement gate removed, enabling iCloud sync surfaced a chain
of CloudKit errors, each rooted in the query-based fetch:
- "Did not find record type: TrackedDomain" — a fresh container has no
schema until the first save, so querying any type failed.
- "SharedDB does not support Zone Wide queries" — the shared database
rejects database-wide queries.
- "field 'recordName' is not marked queryable" — TRUEPREDICATE queries
require a Queryable index on recordName, which auto-created development
schemas do not have.
All three are inherent to reading with CKQuery. Move the user's own
records into a single custom record zone and read every record with
CKFetchRecordZoneChangesOperation, which needs no queryable indexes and
works on a brand-new zone. The shared database is read the same way, one
zone per accepted share. A custom zone is also a prerequisite for CloudKit
sharing, so share root records now live there too.
- Ensure the custom zone exists before every push and fetch (idempotent).
- Save all records — and build tombstone delete IDs — in the custom zone.
- Replace the per-type CKQuery fetch with a per-zone change fetch that
drains truncated responses via the server change token.
Diffstat (limited to 'DomainDigWidget/DomainDigPortfolioWidget.swift')
0 files changed, 0 insertions, 0 deletions
