Uh oh!
There was an error while loading. Please reload this page.
V1.0.0 beta.4 - #439
Conversation
Important Review skippedToo many files! This PR contains 446 files, which is 346 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (446)
You can disable this status message by setting the 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #439 +/- ##
==========================================
+ Coverage 74.52% 81.85% +7.32%
==========================================
Files 158 196 +38 Lines 3761 4755 +994 ==========================================
+ Hits 2803 3892 +1089 + Misses 958 863 -95
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:
|
Extends the MistDemo web demo's Discover panel to look up user
identities by phone number, alongside the existing email and user
record name lookups. `UserIdentityLookupInfo(phoneNumber:)` already
existed in MistKit, so no library change was needed.
- `WebRequests.DiscoverUsers` gains `phoneNumbers: [String]`, decoded
with `decodeIfPresent(...) ?? []` mirroring the other two lists.
- `WebBackend.webDiscoverUsers` and the `CloudKitService` conformance
accept `phoneNumbers` and append
`phoneNumbers.map { UserIdentityLookupInfo(phoneNumber: $0) }` to the
combined lookup-info array.
- Frontend adds a phone-numbers textarea, sends `phoneNumbers` in the
POST body, and loops `discoverUserIdentityWithPhoneNumber` in the
CloudKit JS parity path.
- `DiscoverUsersCall` and `usersDiscoverForwards` cover phone numbers.
Closes#398
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>…ges (#401, #47, #46) * WIP: recovered change-tracking work (pre-verification checkpoint) * Clean up lint violations in change-tracking implementation 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> * Add MistDemo coverage for database and zone change tracking 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> * Classify zoneOperationFailed in serverErrorDetail switch after rebase. ci skip Co-authored-by: Cursor <cursoragent@cursor.com> * Harden MistDemo change-tracking integration tests and skip periphery in lint. Exercise database/zone change APIs against a provisioned custom zone with fatal assertions and incremental sync-token checks, and opt periphery out of lint until the index-store path mismatch is resolved. Co-authored-by: Cursor <cursoragent@cursor.com> * Expose change-tracking in MistDemo web UI and skip new suites on wasm. Add changes/database and changes/zone panels with a two-step prefill flow, and disable the FetchDatabaseChanges/FetchRecordZoneChanges test suites on wasm to avoid CI OOM. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes the two warnings surfaced by the Swift 6.4 Linux lane: 1. `URLRequest+AssetUpload.swift` declared `public import FoundationNetworking` but its only declaration is an `internal init`. Downgraded to `internal import` per the package's import convention. 2. `CloudKitError.networkErrorDescription` read the deprecated `URLError.failureURLString`. Replaced with `failingURL?.absoluteString` plus a fallback that reads the distinct legacy userInfo key directly, so errors carrying only the string key still report their failed URL. The network-error description moves to a new `CloudKitError+NetworkErrorDescription.swift`, mirroring the existing `CloudKitError+ZoneErrorDescription.swift` split, to stay under the 225-line file-length limit. Adds four tests covering both userInfo keys, their precedence, and neither being present. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2
) (#443) * Model per-zone failures on zones/modify; clarify zones/changes syncToken `ZonesModifyResponse.zones` items become `oneOf: [ZoneFetchFailure, Zone]`, matching `changes/database` and `changes/zone`. `zones/modify` is a batch endpoint whose realistic failure mode is partial, and Apple routes all four zone endpoints' failures through the same Zone Fetch Error Dictionary, so the error variant already exists — it just was not wired to this response. The failure variant is listed first, matching every other `oneOf` in the spec. `ZoneFetchFailure` requires `serverErrorCode`, so a success payload fails that branch and falls through to `Zone`. Also rewords the `zones/changes` request `syncToken` description (#433 part 3): it was described as "Meta-sync token", a name the spec does not use for the key. The key stays `syncToken` (#430); only the prose is corrected. Regenerating also repairs Sources/MistKitOpenAPI reproducibility: CodeFactor's bot alphabetized the Foundation imports in Client.swift/Types.swift in 61235b5, so `./Scripts/generate-openapi.sh` no longer reproduced the committed output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2 * modifyZones returns [ZoneChangeResult] and surfaces per-zone failures `modifyZones` mapped every entry straight through as a success, so a batch where some zones failed was reported as a partial success naming no zone and discarding CloudKit's `serverErrorCode`/`reason`. It now returns a bare `[ZoneChangeResult]` — one entry per zone the server returned — mirroring how `modifyRecords` returns a bare `[RecordResult]`. `zones/modify` carries no batch-level metadata, so there is deliberately no `DatabaseChangesResult`-style wrapper struct. `ZoneChangeResult` / `ZoneOperationFailure` from #429 are reused rather than duplicated; the only new code is a second `init(from:)` overload keyed off the generated `ZonesModifyResponse.zonesPayloadPayload`. Two convenience-wrapper bugs fall out of this: - `createZone` threw a bare `.invalidResponse` with no code, reason or zone name when CloudKit rejected the create. It now calls `.get()`, throwing `.zoneOperationFailed` with the full failure. - `deleteZone` discarded the result entirely, so a `ZONE_NOT_FOUND` delete was reported to the caller as success. It now checks every entry. `.zones` / `.failures` accessors are added as concrete `Array` extensions (`[ZoneChangeResult]`, plus `.records`/`.failures` on `[RecordResult]`) rather than one generic extension over `OperationResult<Success, Target>`: Swift cannot bind free generic parameters in an extension's `where` clause. BREAKING: `modifyZones` returns `[ZoneChangeResult]`, not `[ZoneInfo]`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2 * Test per-zone modifyZones failures and the create/delete wrappers Adds a raw-dictionary `ResponseConfig.modifyZonesResponse(zones:)` builder — so a single response can mix success entries and zone error entries — mirroring `databaseChangesResponse(zones:syncToken:moreComing:)`, and a `makeService(zones:)` harness over it. New tests: a mixed batch keeps the successes and reports the failure with its zone name/code/reason; `.get()` on a failed entry throws `.zoneOperationFailed`; zone metadata survives the new success variant; `createZone` surfaces the `ZoneOperationFailure` instead of `.invalidResponse`; and `deleteZone` throws on `ZONE_NOT_FOUND` rather than reporting success. Verified the failure tests fail when the service is reverted to dropping error entries. `ZoneMetadataTests` now matches on the `oneOf` success variant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2 * MistDemo: adopt the [ZoneChangeResult] return from modifyZones - `modify-zones` announces per-zone rejections on stderr (matching how `modify` reports per-record failures) and keeps stdout to the zones that were actually modified, so the JSON/CSV/table output stays machine-parseable. `outputResults` requires `Encodable` and `OperationResult` is `Sendable`-only, so the results cannot be rendered directly. - `webModifyZones` collapses the results all-or-nothing via `.get()`, matching the documented decision in `webLookupRecords`, so the web panel shows a rejection instead of silently returning fewer zones than were asked for. Its `[ZoneInfo]` signature is unchanged, so `WebBackend`, the routes and the mock backend need no changes. - `ModifyZonesPhase` asserted nothing about the results; it now fails the integration run when a create or the cleanup delete is rejected. Split into `createAndVerify` to stay under the cyclomatic-complexity limit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2 * Add CI guard for generated OpenAPI output; document modifyZones results CodeFactor's bot committed to `Sources/MistKitOpenAPI/` in 61235b5, reordering imports in generated files, which broke `./Scripts/generate-openapi.sh` reproducibility until this branch regenerated them. Nothing checked that. `check-generated-openapi.yml` now regenerates and runs `git diff --exit-code Sources/MistKitOpenAPI/` on every PR. It builds the generator from `Scripts/OpenAPITools`, whose version is pinned in sync with mise.toml, so the check is self-contained. That fallback build leaves SwiftPM checkouts in `Scripts/OpenAPITools/.build`, which SwiftLint then walked (the bare `.build` exclude only matches the repo root one) — added as an explicit exclude. Docs: AGENTS.md's per-zone-failures paragraph now covers `zones/modify` and records the oneOf ordering rationale, the operations table names the new return type, and README points at `modifyZones` alongside `createZone`/`deleteZone`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2 * Rename the zones/changes wire token to metaSyncToken (#430) A live container run (iCloud.com.brightdigit.MistDemo / development / private, web-auth) proved `zones/changes` neither returns nor honors `syncToken`: - The response's top-level keys are exactly `[moreComing, metaSyncToken, zones]` — no `syncToken` at all. - Round-tripping the same baseline token: sending `{"syncToken": …}` (what MistKit sent) returned all 40 zones again — the key is silently ignored and page one replays. Sending `{"metaSyncToken": …}` returned 0 zones — honored and correctly advanced. So `fetchZoneChanges` / `fetchAllZoneChanges` pagination has never worked. This supersedes the description-only wording fix in the previous commit, which assumed the mismatch was documentation rather than behavior. Renames the wire key for `zones/changes` **only** — the request body property and `ZoneChangesResponse` — and regenerates. `changes/database`, `changes/zone` and `records/changes` legitimately use `syncToken` and are untouched. Every Swift-facing name is deliberately unchanged: `ZoneChangesResult.syncToken` and its `init(syncToken:)` label, and the `fetchZoneChanges(syncToken:)` / `fetchAllZoneChanges(syncToken:)` argument labels. `MistKitOpenAPI` is an `internal import`, so a wire-key rename is not source-breaking for consumers; only the mapping in `ZoneChangesResult.init(from:)` and the request construction in `CloudKitService+ZoneOperations.swift` change. Adds `CloudKitServiceTests.FetchZoneChanges+WireFormat.swift`, which pins that MistKit sends `metaSyncToken` and never `syncToken`, reads `metaSyncToken` in preference to a decoy `syncToken`, and feeds the previous page's token back under the honored key. Existing `zones/changes` fixtures were emitting the wrong key and are updated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2 * Add tests for [RecordResult].records and .failures accessors Covers the retro-fit Array+RecordResult helpers so codecov patch coverage meets the project threshold on #443. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Collapse CI-only PRs, CodeFactor churn, subrepo push/pull bookmarks, agent-memory notes, and other non-issue work into one commit so the branch log is issue-linked PRs plus this residual. Co-authored-by: Cursor <cursoragent@cursor.com>
Uh oh!
There was an error while loading. Please reload this page.
No description provided.