Repository navigation
cherry-pick(4.5-stable): Guard against nil _performOperations block in REANodesManager (#10229) - #10405
Conversation
…er (#10229) > [!NOTE] > This pull request was authored by AI on behalf of @tomekzaw. ## Summary Fixes #10135. `-[REANodesManager performOperations]` can be invoked on the main queue before `registerPerformOperations:` has run on the JS queue, in which case calling the nil `_performOperations` block crashes with `EXC_BAD_ACCESS` at `0x10`. This PR reads the block ivar into a local and returns early when it is nil. Skipping a flush is harmless — pending updates are picked up on the next drain. This fix was tested and proved to be successful in a production app that we develop at Software Mansion. ## Test plan Trigger an early main-queue drain (e.g. `maybeFlushUIUpdatesQueue` racing module initialization, as described in #10135) before the JS queue registers the block — the app no longer crashes on launch and animations work as expected afterwards. ## Changelog - [x] I added an entry to the `Unpublished` section of each changed package's `CHANGELOG.md`, or this PR does not change `react-native-reanimated` or `react-native-worklets`. (cherry picked from commit 0f8cf6d) Co-authored-by: Tomasz Żelawski <tzelawski@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthrough
Merge Risk: ⚪ Minimal · up to This localized change guards against a nil operation block; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
Cherry-picking #10229