use locks for safer thread safety with purchase/restore continuations#71
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThread-safety improvements to the purchase and restore continuation management in both Android and iOS bridges. Replaced unsynchronized public continuation fields with privately-backed variables protected by locks, and introduced atomic accessor methods ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Note
Medium Risk
Touches purchase/restore bridging on both Android and iOS; concurrency/locking changes can affect transaction completion paths and are hard to test exhaustively, but scope is limited to continuation management.
Overview
Improves thread-safety of the React Native purchase/restore bridge on Android and iOS by guarding active continuations with locks and making completion a single-consumer
take*Continuation()operation.Replaces ad-hoc clearing with safe set/take/conditional-clear helpers, cancels any orphaned in-flight continuation when a new one starts, and adds warnings when result handlers are invoked without an active continuation.
Reviewed by Cursor Bugbot for commit f47c326. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit