Closed WoLewicki closed 9 months ago
Should be proper repo right now.
Not sure who to cc, but looks like it might be connected to yoga
(?) so @NickGerleman. I can just comment the assert and the app I work on (https://github.com/Expensify/App) works correctly from what I tested. Also cc @cipolleschi since it only happens on iOS
, prolly because accessibilityElementsHidden
is iOS
-only prop.
Ok I played a little more with the values and changed accessibilityElementsHidden
to accessibilityViewIsModal
or collapsable
and it still crashes, so looks like this is the code fragment that later causes the ShadowView
s to be different: https://github.com/facebook/react-native/blob/6d77d7b895794c318fba3f52a3dbd73ef2fd5a73/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp#L51 so even more cc @NickGerleman since I see you made many changes in this file (and sorry for extensive pings 😅 )
Ok and changing the prop to something that exists on Android
too like collapsable
makes it crash too.
Hi @WoLewicki, thanks for opening the issue, providing a reproducer and begin the investigation. All this work is extremely valuable to track down the root cause.
We have added the bug in our tracker with high priority, so we are going to work on it in the next days!
Nice to hear, it can be easily mitigated by commenting the assert and the app works correctly then, but I know it is only a workaround for the app and not a solution to the problem.
I wonder if this has to do with changing collapsable
after initial creation. The flag controls view flattening behavior, so we would be going in between having a view, and not.
When RN_SHADOW_TREE_INTROSPECTION
is set, RN Fabric maintains another structure to sanity check operations, which is triggering the assert.
Seems like potentially we are asserting the wrong thing, or that we have a bug somewhere when switching between flattened and non flattened views.
IIRC RN_SHADOW_TREE_INTROSPECTION
recently got disabled in OSS where folks observed some of the local development assertions slowed things down, but since we haven't seen (or at least noticed this) internally, I'm wondering if these are still a valuable source of information. @cipolleschi was more involved with that and will know the tradeoffs.
Yeah, most probably the view is not there anymore and the check fails due to not having the same child in the tree anymore. What is more interesting is the fact that it only happens with those exact props set in the child view. I haven't investigated too much what other combinations can trigger it though.
In main, we disabled the RN_SHADOW_TREE_INTROSPECTION
already exactly because it was creating issues of this sort, with inactionable crashes in Debug mode for the OSS users.
I tested a nightly, which contains 51fd4188005cc3318fecc85b8090453c480af6e8 and the repro is fixed
I'm asking to cherry pick this in 0.73.3.
Description
When having a specific formation of views as shown below, changing the value of
accessibilityElementsHidden
orcollapsable
or anything affected by this code: https://github.com/facebook/react-native/blob/6d77d7b895794c318fba3f52a3dbd73ef2fd5a73/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp#L51 fromfalse
totrue
causes this assert to fail for some reason: https://github.com/facebook/react-native/blob/6d77d7b895794c318fba3f52a3dbd73ef2fd5a73/packages/react-native/ReactCommon/react/renderer/mounting/StubViewTree.cpp#L179. It only happens on new arch.Steps to reproduce
true
Click me
button to see that the app crashes.React Native Version
0.73.2
Affected Platforms
Runtime - iOS Runtime - Android
Areas
Fabric - The New Renderer
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/WoLewicki/NewArchStylingBug
Screenshots and Videos
No response