ioscloudkitdashboardckmodifyrecordsoperationckrecordzone

Records in CKRecordZone still show in CloudKit Dashboard


We have an application where we sync records to CloudKit.

They are stored in a custom zone. We need to provide a functionality to "clear all data" from CloudKit. Since the number of records can be high we do not want to delete them individually or in batch (could be many batches). So we are deleting the custom zone directly.

The zones are deleted successfully but the records still show in CloudKit dashboard. Is this expected?


Solution

  • What you did should be correct, as the doc said:

    Deleting a record zone also deletes any records it contains.

    But what you see in Cloud Dashboard should be caused by those cached records, which will be removed at last in the future, just not instantly happens.

    There's no clear explanation about it in doc, but it indeed mentioned similar strategy on CKAsset:

    ... When no asset objects refer to the data, the server lazily deletes the asset data at some point in the future. (Exactly when is not specified, but assume at least several days.)