Android: Crash due to race in OTPublisher when multiple properties change
In "@vonage/client-sdk-video-react-native": "^2.29.1" on Pixel 9 API 35 simulator.
When setting OTPublisher properties and style attributes simultaneously the application can crash with the following error:
Error while updating property 'publisherId' of a view managed by: OTPublisherViewManager
null
The specified child already has a parent. You must call removeView() on the child's parent first.
This happens inside the view manager stack, see attached screenshot.
Example that demonstrates the issue:
<OTPublisher
properties={{
publishAudio: audioEnabled,
publishVideo: videoEnabled,
}}
style={{
width: '100%',
height: '100%',
zIndex: 1000,
...(!videoEnabled ? { opacity: 0 } : {})
}}
/>
Where videoEnabled is a React useState property, toggling the property causes this crash, nearly all of the time.
I get the same error But I think this is a problem of fabric renderer, not opentok-react-native If I add key={JSON.stringify(publisherProperties)} this crash doesn't happen
Thanks, we're looking into this issue.