Add changes/database and changes/zone endpoints; deprecate zones/changes (#401, #47, #46) - #429
Add changes/database and changes/zone endpoints; deprecate zones/changes (#401, #47, #46)#429leogdion wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ReviewReviewed the diff (excluding generated A few things worth a look before/after merge: 1.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v1.0.0-beta.4 #429 +/- ##
================================================
Coverage ? 77.32%
================================================
Files ? 172
Lines ? 4115
Branches ? 0
================================================
Hits ? 3182
Misses ? 933
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7eb84b6 to
3546bcf
Compare
Resolves the 14 SwiftLint violations outstanding when the implementing
agent stalled, plus two periphery findings introduced by the file splits:
- Expand `guard ... else { return nil }` one-liners
(conditional_returns_on_newline) in DatabaseChangesResult,
RecordZoneChangesResult, ZoneChangesAccumulator and
CloudKitService+DatabaseChanges.
- Put each argument on its own line in the paginator's
accumulator.merge(...) call (multiline_arguments{,_brackets}).
- Wrap the unbreakable DocC symbol link in ZoneChangesRequest with a
scoped line_length disable/enable pair, keeping the doc comment
contiguous so it stays attached to the declaration.
- Split CloudKitError+ZoneErrorDescription.swift out of
CloudKitError+ErrorDescription.swift, and
...FetchRecordZoneChanges+PaginationLimits.swift out of
...+Pagination.swift, to bring both files under the length limit.
- Drop the import and test helper the splits left unused.
swift test: 573 tests / 182 suites passing. Scripts/lint.sh: 0
violations in 416 files, no unused code. generate-openapi.sh reproduces
the committed Sources/MistKitOpenAPI output.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Introduce fetch-database-changes and fetch-zone-record-changes CLI, migrate phases/web off deprecated fetchZoneChanges, and keep fetch-changes on records/changes. Co-authored-by: Cursor <cursoragent@cursor.com>
3546bcf to
99b9f1e
Compare
Summary
Implements CloudKit's two current
changes/*endpoints and reconciles the change-tracking naming confusion documented in #401.records/changesfetchRecordChangesfetchAllRecordChangeschanges/databasefetchDatabaseChangesfetchAllDatabaseChangeschanges/zonefetchRecordZoneChangesfetchAllRecordZoneChangeszones/changesfetchZoneChangesfetchAllZoneChangesBoth new operations follow the existing page-primitive + auto-paginating-extension pattern, with
maxPagesceilings and stuck-token detection, matchingfetchAllRecordChanges.#401 — the three requested resolutions
changes/databaseandchanges/zoneadded toopenapi.yamland regenerated;zones/changesmarked deprecated in favor ofchanges/database.fetchZoneChanges/fetchAllZoneChangesare now@available(*, deprecated), pointing atfetchDatabaseChanges. Per the repo's@availableconvention,deprecatedis correct here because these symbols have a replacement.AGENTS.md(CLAUDE.md) ops table updated.Per-zone failure handling
changes/databaseandchanges/zoneboth return per-zone results that can fail individually. Rather than dropping failures, the result types expose both sides —DatabaseChangesResult.changedZones/.failuresandRecordZoneChangesResult.changes/.failures, backed byZoneChangeResult/ZoneRecordChangesResultandZoneOperationFailure. This follows the RecordResult success-or-failure pattern the repo applies elsewhere.Verification
Run on macOS, Apple Swift 6.3.2 (
arm64-apple-macosx28.0):swift buildswift test./Scripts/lint.shswift-format./Scripts/generate-openapi.shSources/MistKitOpenAPI/byte-identicallyNot verified locally — relying on CI: wasm32/wasm-embedded, Windows, Android, Linux, and the non-macOS Apple platforms.
Wire format
Local
.claude/docs/webservices.mdis abbreviated on these endpoints, so shapes were taken from Apple's archived CloudKit Web Services Reference:No live-service call was made. Field names come from the archived reference, not from an observed payload.
Warning
Possible pre-existing bug, deliberately not changed here. Apple documents
zones/changesas usingmetaSyncToken, but MistKit sends and readssyncToken. If the doc is right, that pagination is silently broken. It was left alone because Apple's own page contradicts itself — themoreComingtext refers back to "the includedsyncTokenkey" — so this needs a live-response check rather than a doc-driven guess. Surfaced from #386 review; worth its own issue.Note on this branch's history
The implementing agent hit a cross-worktree
git stashcollision mid-run (the stash stack is repo-global, so a sibling worktree'sstash popdisplaced this branch's WIP) and then stalled before finishing verification. The work was recovered intact and checkpointed in79f1f31;de59ebdthen resolves the 14 SwiftLint violations that were still outstanding, plus two periphery findings introduced by the file splits needed to satisfy the file-length rule. Full verification above was re-run from scratch on the final tree, not inherited.Closes #401
Closes #47
Closes #46
🤖 Generated with Claude Code