Why is CKModifyRecordsOperation to batch delete records in CloudKit not deleting records?

My Code:

let op = CKModifyRecordsOperation(recordIDsToDelete:recordIDsToDelete)

op.modifyRecordsCompletionBlock = { _, deleteRecordIDs, error in

if error == nil  {

 print("successful delete  deleteRecordIDS = \(deleteRecordIDs)")

 } else {
     print("delete error = \(error?.localizedDescription)") 
}

}
op.database = CKContainer.default().privateCloudDatabase op.qualityOfService = .userInitiated CKContainer.default().privateCloudDatabase.add(op)

My problem is that CKRecord are not deleted once I reinstall the app: when I reinstall the app and try to delete a CloudKit record, the method is executed successfully (error is nil) but the records are still in CloudKit Dashboards.

That sounds pretty strange and ... interesting. Your code snippet is quite straightforward and has nothing wrong, and so I can't comment based on that. If you provide more details about how you trigger and observe the issue, or even better, a minimal project with detailed steps to reproduce the issue, I'd be interested in taking a look.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

When the delete button is clicked, it invokes the deleteRecord() method, as defined in the preceding code.

Subsequently, the system outputs the message "successful delete deleteRecordIDS = ...," (The deleteRecordIDs is not empty.)

Finally, I refreshed the CloudKit dashboard and clicked the Query Records button on the web interface; however, the deleted CKRecord still appears to exist.

When I reinstalled the app, The record was downloaded again.

I would like to upload the minimal Xcode test project, but I am currently unsure of the procedure.

Why is CKModifyRecordsOperation to batch delete records in CloudKit not deleting records?
 
 
Q