Hi there
We're using CloudKit in our app which, generally, syncs data perfectly between devices. However, recently the sync has stopped working (some changes will never sync and the sync is delayed for several days even with the app open on all devices). CloudKit's logs show the error „You can't save and delete the same record" and „Already have a mirrored relationship registered for this key", etc. We’ve a hunch that this issue is related to a mirrored relationship of one database entity.
Our scenario:
- We've subclassed the database entities.
- The database model (which we can't share publicly) contains mirrored relationships.
- We store very long texts in the database (similar to a Word document that contains markup data – in case that’s relevant).
- Deleting all data and starting with a completely new container and bundle identifier didn’t help (we tried that multiple times).
- This issue occurs on macOS (15.2(24C101) as well on iOS (18.2).
Any hints on how to get the sync working again? Should we simply avoid mirrored relationships?
Many thanks