deeje / CloudCore

Robust CoreData-CloudKit synchronization: offline editing, relationships, private, shared and public databases, field-level deltas, encrypted values, cacheable assets, and more.
MIT License
157 stars 17 forks source link

Add semaphore to limit one change being processed at once #16

Closed davidrothera closed 3 years ago

davidrothera commented 4 years ago

When we create multiple objects in quick succession there is a race condition where the same records are added to by synced multiple times, this causes a CKError and stops the rest of the batch from completing.

Adding a semaphore here ensures that only one of the processChanges() blocks in run at once and therefore ensures that records are converted, processed and removed from history all before running again ensuring no duplicates.

davidrothera commented 4 years ago

Fixes #15

deeje commented 3 years ago

integrated into version 4.0