title: Deleted CloudKit records Reappear
body: <p>I'm building an iOS application using CloudKit.</p>
  
  <p>It should allow a user to add, edit and delete <code>Products</code> in the cloud. The user can organize these in Folders. These folders are just other Record Types in cloudkit. There is no limit to the levels of folder the user can use, as any folder can just hold a <code>CKReference</code> to it's parent Folder. All CloudKit communication in my app happens in a dedicated CloudKitController Class</p>
  
  <p>This all works, but stops working after a while for no clear reason.</p>
  
  <p>When I test my app, I don't even user folders that are multiple levels deep. However, after using it a while (up to a week), All deleted records seem to reappear on CloudKit. A couple of notes on this:</p>
  
  <ul>
  <li>When I reset my CloudKit dashboard and start all over again, it works perfect. No code changes made.</li>
  <li>Obviously, I'm constantly editing my code as the app is in development. However, I generally don't edit the data types in my code that are to be stored in CloudKit. When I do, this issue does not arise straigt afterwards</li>
  <li>Changes in the CloudKit Dashboard (e.g. adding data types) do not cause this issue</li>
  <li>Am not storing any records locally, like in core data. They just sit in a singleton as long as I use them</li>
  <li>When I go to CloudKit Dashboard, the Product Record Type shows it has e.g. 13 instances. Sometimes it's so bad, that my app actually loads over 100. I can also see them when I go to the recordZone, but still the RecordType says it only has 13 instances </li>
  <li>Deleting these records in CloudKit Dashboard only makes them disappear for a while. When I reload the page, they pop up again.</li>
  </ul>
  
  <p>It has been going like this for a while now, and I have checked my code, the Apple Library and google numerous of times but I cannot figure out what causes this issue.</p>
  
  <p><strong>Question:</strong>
  Would anyone know anything on how to overcome this issue? As I said, I've been running into this for weeks, and resetting my CloudKit dashboard only 'cures' it for up to a week, then it pops up again. I'd also be more than happy to post any code if that would help you answer my question. I haven't posted any code initially, as I have no clue what code might cause this.</p>
  
  <p>Any answer would be highly appreciated</p>