Closed pawisesa closed 1 year ago
The issue here is that m_callFunctionReturnFlushedQueue returns a list of native module calls from the bridge that should be called. But this code isn't calling them. This essentially means that any calls to a native module being made in response to this event will not get called.
Problem Description
Using a brand-new test app created following https://microsoft.github.io/react-native-windows/docs/getting-started and using these dependencies:
we see that when it loads our internal library that downloads a metadata and renders react-native-xaml elements according to it, where the interactable elements such as TextBoxes, Button, etc that are rendered and have been hooked up to our library on interaction (e.g. OnTextChanged for TextBoxes, OnClick for buttons, etc), we see that our callback functions in JS are run but promises that are generated in that callback function are not processed (so the functions attached to the promises for on success and on failure themselves are never run).
When we then change pages/load a different component from our library we immediately get an app crash due to "disconnectAnimatedNodeFromView".
Looking into the react-native-xaml code we found this code in XamlMetadata.cpp:
that triggers the JS interaction callback, but this may be dangerous because m_callFunctionReturnFlushedQueue is retrieved directly from the JSI bridge.
Steps To Reproduce
Unfortunately, due to the fact that our library is internal to Microsoft I can't share the code here, please ping me at @pawisesa to get a repro and discuss the issue.
Expected Results
For JS promises to be processed and the app to not crash when rendering a different component.
Environment