Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fabric crash in NativeReanimatedModule::removeShadowNodeFromRegistry #4020

Merged
merged 2 commits into from
Feb 3, 2023

Conversation

tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented Feb 2, 2023

Summary

This PR fixes a Fabric crash in NativeReanimatedModule::removeShadowNodeFromRegistry. I don't know the exact root cause but I know how to fix it.

First, I added missing makeShareableShadowNodeWrapper call. However, since only the view tag is required on the native side, there's no need to pass the whole ShadowNodeWrapper, so I simply grab the view tag from this._viewTag and pass it to the cleanup worklet via closure.

Steps to reproduce the issue

  1. Launch FabricExample on iOS
  2. Open "forwardRef & useImperativeHandle" example
  3. Increase animation duration to 3000 ms
  4. Randomly click both buttons
  5. Go to previous screen
  6. Crash
Nagranie.z.ekranu.2023-02-2.o.16.06.55.mp4

Test plan

@tomekzaw tomekzaw requested a review from piaskowyk February 2, 2023 15:23
@tomekzaw tomekzaw merged commit 495bb21 into main Feb 3, 2023
@tomekzaw tomekzaw deleted the @tomekzaw/fix-fabric-crash-remove-from-registry branch February 3, 2023 09:21
tomekzaw added a commit that referenced this pull request Feb 21, 2023
…stry` (#4076)

## Summary

Follow-up to #4020.

## Test plan

Check if Conditional demo from FabricExample works.
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
…stry` (software-mansion#4020)

## Summary

This PR fixes a Fabric crash in
`NativeReanimatedModule::removeShadowNodeFromRegistry`. I don't know the
exact root cause but I know how to fix it.

First, I added missing `makeShareableShadowNodeWrapper` call. However,
since only the view tag is required on the native side, there's no need
to pass the whole ShadowNodeWrapper, so I simply grab the view tag from
`this._viewTag` and pass it to the cleanup worklet via closure.

## Steps to reproduce the issue

1. Launch FabricExample on iOS
2. Open "forwardRef & useImperativeHandle" example
3. Increase animation duration to 3000 ms
4. Randomly click both buttons
5. Go to previous screen
6. Crash


https://user-images.githubusercontent.com/20516055/216365412-edb406ad-6947-4cdf-94aa-5b82bd079fab.mp4

## Test plan

<!-- Provide a minimal but complete code snippet that can be used to
test out this change along with instructions how to run it and a
description of the expected behavior. -->
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
…stry` (software-mansion#4076)

## Summary

Follow-up to software-mansion#4020.

## Test plan

Check if Conditional demo from FabricExample works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants