3 Replies
      Latest reply on May 5, 2018 1:15 AM by newwbee
      MendelK Level 2 Level 2 (90 points)

        Hi!


        I am using CKFetchRecordZoneChangesOperation to fetch changes for a single zone at a time. fetchAllChanges is set to NO.


        When pulling changes from a shared zone, with a NULL server change token (to fetch all objects from scratch), the download sometimes (25% of the time) fails along the way. Here's what I am seeing when downloading changes:


        CKFetchRecordZoneChangesOperation token NULL

        Got token A

        Save local cache

        CKFetchRecordZoneChangesOperation token A

        Got token B

        Save local cache

        CKFetchRecordZoneChangesOperation token B

         

        ERROR -> "Change Token Expired" (21/2026); server message = "client knowledge differs from server knowledge"

         

        OR

         

        ERROR -> "Internal Error" (1/1000); "Encountered an error fetching records", NSUnderlyingError = "<CKError 0x60001105bc90: \"Internal Error\" (1000/1013); \"Fetching asset failed\">";


        Strangely, running CKFetchRecordZoneChangesOperation with Token B again after the failure works perfectly.


        Anyone can shed some light on this strange behaviour? This happens on macOS as well as iOS.


        Thanks in advance!