Repository navigation
fix(sync): apply changes and deletions to library records a build cannot read by id and standing - #4345
Merged
Conversation
…not read by id and standing
…owns when iCloud deletes it
…t's sync metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A record the connection library stores but this build cannot decode now meets iCloud sync by its id and its standing, never by its payload. CloudKit hands a deletion over as a record ID and type only, and a save starts from the last known server record (CKSyncEngine sample,
CKRecordSaveChangedKeys); the repo already defers what a device cannot apply yet (deferredDeletions,adoptReadableRecordTypes).KeychainStoring.deviceOnlyKeys(endingWith:)), since naming a plugin field needs the type the record no longer gives.SyncMetadataStorage.recordConnectionStanding): a Local only connection on macOS keeps its iCloud record and cached server copy, so neither tells Local only apart.CloudKitSyncEngine.fetch(recordIDs:)sends at most 200 ids per operation and splits a batch CloudKit refuses as too large, as its own refetch does, so a large recovery backlog still goes through..claude/rules/data-sync-storage.md, with rows for the new metadata keys.Test plan
SyncUnreadableCopiesTests(macOS): remote delete of an unread synced connection removes it; a Local only one stays byte-identical; no standing holds the deletion; a remote change is held and not cached; a newer build reading the copy fetches the record by id and takes the change; held deletions apply once readable, yield to a record the zone still lists, and wait while the category is off; the upload mark is held; an import leaves the id alone.AppStateSyncWiringTests(iOS): the same deletion, kept-off, held change and newer-build (fetch by id) cases through the app's sync wiring, plus an unread group.SyncMetadataStorageTests,LibraryFileRecordsTests(swift test): standing, held changes and deletions, a save refused over a kept record.Refs #4273