react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

draft: fix infinite loop in REASharedTransitionManager

Open preynal opened this issue 1 year ago • 4 comments

Summary

This fixes an infinite loop in REASharedTransitionManager, in getSharedElementForCurrentTransition, when siblingViewTag is nil and _findPrecedingViewTagForTransition returns nil, it will get stuck in an infinite loop and freeze the app.

Test plan

You can test this by setting sharedTransitionTags

preynal avatar Sep 23 '24 08:09 preynal

I've applied your changes as a patch and it seems like it fixes the crashing indeed but the shared element transition doesn't work when you try to repeat it within the same shareTag

arekkubaczkowski avatar Sep 26 '24 05:09 arekkubaczkowski

I've applied you changes as a patch and it seems like it fixes the crashing indeed but the shared element transition doesn't work when you try to repeat it within the same shareTag

thanks, I've seen that too but I didn't know if it was related to my use case, or the crash, I will look into it

preynal avatar Sep 26 '24 07:09 preynal

@preynal sorry for bothering, do you plan to take a look on it in the nearest future?

arekkubaczkowski avatar Oct 04 '24 05:10 arekkubaczkowski

I've applied you changes as a patch and it seems like it fixes the crashing indeed but the shared element transition doesn't work when you try to repeat it within the same shareTag

I wasn't able to get it to work correctly, I might get back to it in the future when I have more time

preynal avatar Oct 04 '24 08:10 preynal

This solved the crash for me too although not 100% sure if maxIterations is needed as it worked fine for me without.

TomAtterton avatar Nov 04 '24 11:11 TomAtterton

Thanks for your PR and your time! We're currently rewriting the Shared Element Transition implementation for the new architecture and I hope we'll resolve all the issues that occurred in the Paper implementation. Since these changes are no longer relevant, I'll go ahead and close this PR.

piaskowyk avatar Jun 06 '25 09:06 piaskowyk