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

Android: Crash due to race in OTPublisher when multiple properties change

Open jstr opened this issue 1 year ago • 2 comments

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.

Image

jstr avatar Apr 08 '25 11:04 jstr

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

gag0712 avatar Apr 10 '25 17:04 gag0712

Thanks, we're looking into this issue.

beHaze avatar May 16 '25 17:05 beHaze