2 Replies
      Latest reply on Nov 22, 2019 10:52 AM by JimmyCricket
      JimmyCricket Level 1 Level 1 (10 points)

        After doing a CKModifyRecordsOperation, what's the suggested way to get the current change token? Since in most cases*, pushing changes won't cause a notification kickback and when there is a trigger to fetch changes, the record will just sync to match the current store data so nbd, but since I'm in an open operation I'd also like to fetch the changeToken from the completed operation to prevent that reduntant occurance.

         

        The documentation on clientChangeTokenData gives a hint: When you modify records from a fetch operation, specify a client-generated data token using this property to indicate which version of the record you last modified. Compare the data token you supplied to the data token in the next record fetch to confirm the server has successfully received the device’s last modify request.

         

        ... but I'm having a hard time visualizing this process for what I'm specifically looking to do. Do you think after writing, I do a (in this case) database change fetch to get the up to date token? If so and ignoring changes from that fetch, is there a way I can pin the history to ensure the token I'm getting isn't one containing changes that originated outside of the app (in the case of multiple users editing concurrently).

         

        Kind of a weird question, but any insight would be much appreciated!