You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Zone payloads: deleted, zoneType unmodeled and ownerRecordName never decodes (confirmed live) #444
A live zones/changes call against a real container returned zone objects that carry deleted and zoneType, neither of which MistKit models. deleted is the significant one: a caller currently cannot tell a deleted zone from a live one.
Evidence
POST zones/changes on iCloud.com.brightdigit.MistDemo / development / private DB, no sync token:
Every zone in the response had "deleted": true and a zoneType inside zoneID.
Current state
After #427, the shared Zone schema in openapi.yaml models zoneID, syncToken, atomic. The domain ZoneInfo carries zoneName, ownerRecordName, capabilities, syncToken, atomic.
Neither deleted (zone level) nor zoneType (inside zoneID) is represented, so both are silently dropped on decode.
Note #427 deliberately implemented only the subset confirmed against Apple's archived reference and left unconfirmed fields out rather than guessing (see .claude/memory/reference_cloudkit_zone_dictionary.md). This issue supplies live confirmation for two more fields — the same standard of evidence, now from an actual response rather than the docs.
Why deleted matters
zones/changes is a change feed: a deleted zone is exactly the kind of change a sync client must observe. Returning it as an ordinary ZoneInfo indistinguishable from a live zone means a caller replaying changes will treat deletions as creations.
Worth checking whether changes/database (DatabaseChangedZone, the supported replacement per #401) carries the same field — it likely does, and that path is the one callers should be using.
What to do
Confirm the field set against changes/database as well as zones/changes before encoding — do not assume they match.
Add deleted: Bool? to the Zone schema (and DatabaseChangedZone if confirmed there), and zoneType to ZoneID, in openapi.yaml; regenerate via ./Scripts/generate-openapi.sh.
Surface them on the domain types. Consider whether deleted deserves better than Bool? on ZoneInfo — a change feed arguably wants a per-zone enum (changed vs deleted), which would be a larger design change.
zoneType observed value: REGULAR_CUSTOM_ZONE. Find the full set before modeling it as an enum rather than a string.
grep -c ownerRecordName openapi.yaml → 0. The string does not appear in the spec at all.
ZoneInfo.init(from:) maps ownerRecordName: zoneID.ownerName (Sources/MistKit/Models/Zones/ZoneInfo.swift:94), so for every zone read back from the server the owner decodes as nil — the field is silently dropped on the wire.
Why this matters beyond cosmetics
#146 / #426 chose ZoneID over a bare zoneName: String specifically because ZoneID carries the owner, and shared zones live in the owner's database and are unaddressable without it. If the owner never round-trips, that rationale doesn't hold up in practice: you cannot read a shared zone's owner back out of any zone response.
Not yet established: the request direction
I tried to determine whether CloudKit accepts ownerName or requires ownerRecordNamein requests, but my hand-rolled zones/lookup body was malformed — all four variants (both spellings × valid/bogus owner) returned BAD_REQUEST, which tells us nothing about the key name. That question is still open and should be settled with MistKit itself (which knows the correct request envelope) rather than raw HTTP.
Both directions need checking before changing the spec: it is possible CloudKit accepts ownerName on input and emits ownerRecordName on output, in which case the fix is asymmetric.
Scope note
This is pre-existing and orthogonal to #430's metaSyncToken rename (PR #443) — deliberately left out of that PR. Grouping it here since it is the same class of finding: a zone-payload field that live responses carry and MistKit does not model correctly.
changed the title [-]Zone responses carry `deleted` and `zoneType` — neither is modeled (confirmed live)[/-][+]Zone payloads: `deleted`, `zoneType` unmodeled and `ownerRecordName` never decodes (confirmed live)[/+]on Aug 28, 2026
Activity
leogdion commentedon Aug 28, 2026
Also confirmed:
ownerRecordNamevsownerName— the zone owner never decodesVerified against live
zones/listandzones/changesresponses oniCloud.com.brightdigit.MistDemo:But
openapi.yaml:1338declares:grep -c ownerRecordName openapi.yaml→ 0. The string does not appear in the spec at all.ZoneInfo.init(from:)mapsownerRecordName: zoneID.ownerName(Sources/MistKit/Models/Zones/ZoneInfo.swift:94), so for every zone read back from the server the owner decodes asnil— the field is silently dropped on the wire.Why this matters beyond cosmetics
#146 / #426 chose
ZoneIDover a barezoneName: Stringspecifically becauseZoneIDcarries the owner, and shared zones live in the owner's database and are unaddressable without it. If the owner never round-trips, that rationale doesn't hold up in practice: you cannot read a shared zone's owner back out of any zone response.Not yet established: the request direction
I tried to determine whether CloudKit accepts
ownerNameor requiresownerRecordNamein requests, but my hand-rolledzones/lookupbody was malformed — all four variants (both spellings × valid/bogus owner) returnedBAD_REQUEST, which tells us nothing about the key name. That question is still open and should be settled with MistKit itself (which knows the correct request envelope) rather than raw HTTP.Both directions need checking before changing the spec: it is possible CloudKit accepts
ownerNameon input and emitsownerRecordNameon output, in which case the fix is asymmetric.Scope note
This is pre-existing and orthogonal to #430's
metaSyncTokenrename (PR #443) — deliberately left out of that PR. Grouping it here since it is the same class of finding: a zone-payload field that live responses carry and MistKit does not model correctly.[-]Zone responses carry `deleted` and `zoneType` — neither is modeled (confirmed live)[/-][+]Zone payloads: `deleted`, `zoneType` unmodeled and `ownerRecordName` never decodes (confirmed live)[/+]Model zone payload fields confirmed live in issue #444.
Merge pull request #451 from brightdigit/444-zone-payloads
docs(memory): record that dogfood pins stay on branches, not tags
chore: track the MistKitConfiguration integration branch; drop the ha…
Fill out the Unreleased release notes section
Model zone payload fields confirmed live in issue #444. (#478)