paulw11 / Seam3

Cloudkit based persistent store for Core Data
Other
209 stars 25 forks source link

Preventing Duplicate Records? #78

Closed daviddelmonte closed 6 years ago

daviddelmonte commented 6 years ago

What is the best practice using Seam3 to prevent creating duplicate records. This is occurring for me, when I run my project on multiple devices.

Thanks to all!

daviddelmonte commented 6 years ago

I think I should explain in more detail. I run a fetch to see various supply entities. If the supplies return empty, I load some pre-built records. These are the duplicates I spoke of. Seems like a timing situation?

daviddelmonte commented 6 years ago

To avoid these duplications, I've refined granularity so I check each entity as to whether it's supposed to be uploaded rather than the batch of (~15) entities . This works reasonably well. However, if I create and sync these all at once, I get about half the entities synced -- different each time. If I load them slowly - ie, about 5 minute gap between each, they all sync ok.

Surely, there must be a better method where I can sync multiple entities without delay.

daviddelmonte commented 6 years ago

I opened this as a new issue.