Skip to content

CloudKit sync fails with "Limit Exceeded" error when syncing more than 400 items #333

@Ryu0118

Description

@Ryu0118

Description

When synchronizing tables with a large number of records (e.g., LocationPoint with GPS coordinates), CloudKit sync fails with a "Limit Exceeded" error because CloudKit has a hard limit of 400 items per request.

Caught error: <CKError 0x1310f9230: "Limit Exceeded" (27/1020); 
"Your request contains 1360 items which is more than the maximum number of items in a single request (400)">: 
SQLiteData CloudKit Failure

This occurs during initial sync or when a large batch of records needs to be synchronized.

Expected behavior

SyncEngine should automatically chunk large batches of records into groups of 400 or fewer items per CloudKit request, similar to how batch operations are handled in the application layer.

Actual behavior

SyncEngine attempts to sync all pending records in a single CloudKit request, which fails when the count exceeds 400 items.

Reproducing scenario

  1. Create a table that accumulates many records
  2. Enable iCloud sync with SyncEngine for that table
  3. Record hundreds of location points locally
  4. Trigger sync

Result: CloudKit sync fails with "Limit Exceeded (27/1020)" error

Suggested solution

Add automatic chunking in SyncEngine to split large batches into 400-item chunks before sending to CloudKit, similar to:

Destination operating system

iOS 26

Xcode version information

Xcode 26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions