-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Duplicate reactTag being pushed to sharedTransitionGroups_[sharedTransitionTag]
causing freeze.
#7030
Comments
Hey! 👋 It looks like you've omitted a few important sections from the issue template. Please complete Steps to reproduce section. |
UpdateIt looks like shared transition groups are pushing duplicate reactTags to /*
The top screen on the stack triggers the animation, so we need to find
the sibling view registered in the past. This method finds view
registered in the same transition group (with the same transition tag)
which has been added to that group directly before the one that we
provide as an argument.
*/
int LayoutAnimationsManager::findPrecedingViewTagForTransition(const int tag) {
std::cout << "findPrecedingViewTagForTransition: " << tag << std::endl;
auto const &groupName = viewTagToSharedTag_[tag];
std::cout << "groupName: " << groupName << std::endl;
auto const &group = sharedTransitionGroups_[groupName];
std::cout << "group: " << group.size() << std::endl;
// Print all the tags in the group
std::cout << "Group contents: ";
for (const auto &viewTag : group) {
std::cout << viewTag << " ";
}
std::cout << std::endl;
auto position = std::find(group.begin(), group.end(), tag);
if (position != group.end() && position != group.begin()) {
return *std::prev(position);
}
return -1;
} Which produced this output.
The sharedTransitionGroups_[sharedTransitionTag].push_back(tag); If you update that to the following, the freeze no longer happens. // Check if tag already exists in group
auto &group = sharedTransitionGroups_[sharedTransitionTag];
if (std::find(group.begin(), group.end(), tag) == group.end()) {
// Only add if tag isn't already in group
group.push_back(tag);
} Now this is only treating the symptom of the freeze, the question now is... why are duplicate tag ids being pushed to this group at all? Does that make sense to anyone? |
sharedTransitionGroups_[sharedTransitionTag]
sharedTransitionGroups_[sharedTransitionTag]
sharedTransitionGroups_[sharedTransitionTag]
causing freeze.
Fix proposed #7040 |
@aymather I have the same issue. |
@VladYuskiv I have a pull request open and should be approved. There are still some buggy behaviors with this though, I'll try to sort them out. |
Description
When I have multiple shared transitions on my screens and I engage/remove them a couple of times, my app runs into a freeze. I am unable to reproduce this in a minimal example, but it's happening in my production app. However, I have tracked down the problem...
In
REASharedTransitionManager.m (lines 263:269)
Relevant Crash Logs
Environment
Snack or a link to a repository
https://github.com/aymather/shared-element-transitions-hanging.git
Reanimated version
3.16.6
React Native version
0.74.3
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Fabric (New Architecture)
Build type
Debug app & dev bundle
Device
iOS simulator
Device model
iPhone 15 Plus
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: