Back to Feed
Link github

✅ PR: fix: replace ReadWriteLock with NSLock for consistent thread-safety

Repository: PostHog/posthog-ios
PostHog iOS SDK


💡 Motivation and Context

The @ReadWriteLock property wrapper provides a false sense of thread-safety for collection types because the lock is acquired and released between separate operations, allowing the underlying collection to change between a check and a mutation.

💚 How did you test it?

Added concurrency tests covering concurrent adds, deletes, and mixed operations.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.
Visit github.com