refactor!: Introduce Synchronized primitive and adapt classes to its use#974
refactor!: Introduce Synchronized primitive and adapt classes to its use#974hollyschilling-cio wants to merge 33 commits intomainfrom
Conversation
…ration to replace TaskBag. - Rewrote EventBusObserversHolder to utilize Synchronized to protect its contents. - Updated EventBusHandlerTest to fix test that depended upon a memory leak that is now fixed.
…y and replaced them with uses of Synchronized.
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. |
SDK binary size reports 📊SDK binary size of this PRSDK binary size diff report vs. main branch |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #974 +/- ##
==========================================
+ Coverage 65.40% 66.46% +1.06%
==========================================
Files 172 171 -1
Lines 8024 8347 +323
==========================================
+ Hits 5248 5548 +300
- Misses 2776 2799 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Incidentally added a `isEmpty` method to Synchronized Collection extension because the linter required it and it was a good idea.
…Synchronized, AsyncOperation, and DictionaryProtocol.
…e in method name.
…they were crashing during testing.
… common base model.
… migrating them to use SwiftTesting. Removed additional references to AutoLenses.
… tests because it seems to cause problems with GitHub.
| await asyncBlock() | ||
| finish() | ||
| } | ||
| } |
There was a problem hiding this comment.
AsyncOperation cancellation leaves operation in incomplete state
When AsyncOperation is cancelled after start() is called but before the Task body executes, the guard statement at line 59 returns early without calling finish(). Since start() already set isExecuting = true, the operation remains in an invalid state (isExecuting = true, isFinished = false) indefinitely. This can cause OperationQueue to hang waiting for operations that will never complete. The issue is particularly relevant in CioEventBusHandler.deinit which calls cancelAllOperations() on pending operations.
NSRecursiveLockComplete each step to get your pull request merged in. Learn more about the workflow this project uses.
Note
Modernizes concurrency and thread-safety across the SDK.
Synchronized<T>wrapper andAsyncOperationadded; many classes updated to useSynchronizedorNSRecursiveLock(e.g.,EventBusObserversHolder,CioEventBusHandler,QueueInventoryMemoryStoreImpl,ModuleTopLevelObject,CioSimpleTimer,PushHistoryImpl).QueueTask,QueueTaskMetadata, andQueueTaskRunResultsfields made mutable (var); removedAutoLensesusage and generated files; deletedArrayExtensions.mapNonNilin favor ofcompactMap.Synchronizedand usesOperationQueueasync ops; handler loads/replays/posts events via queued async operations.Lock,LockManager, andTaskBag; rewroteRingBufferwith clearer indices, count, and bulk enqueue.SynchronizedTests; updated event bus, atomic, ring buffer, and push history tests.macos-15; Fastlane simulator updated toiPhone 16; sample app Xcode project cleaned of lenses references.Written by Cursor Bugbot for commit f8e6f93. This will update automatically on new commits. Configure here.