You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Call will sometimes reconnect after leaving. For me this happens in React development mode when double render causes useEffect to join and leave a call in quick succession (see snippet below for useEffect logic).
To Reproduce
Use this code snippet in React development mode:
letpromises=Promise.resolve();functionserially(promise){promises=promises.finally(()=>promise());}exportdefaultfunctionApp(){const[state,setState]=useState<any>(null);useEffect(()=>{constcallCounter=++counter;constclient=StreamVideoClient.getOrCreateInstance({
apiKey,
user,
token,});constcall=client.call("default",callId);call.state.callingState$.subscribe((state)=>console.log(`[${callCounter}] call state ${state}`),);letisActive=true;serially(()=>call.join().then(()=>isActive&&setState({ client, call })),);return()=>{isActive=false;setState(null);serially(()=>call.leave());};},[]);return(state&&(<StreamVideoclient={state.client}><StreamTheme><StreamCallcall={state.call}><SpeakerLayout/><CallControls/></StreamCall></StreamTheme></StreamVideo>));}
Open the example in browser and allow permissions (you may need to reload multiple times for this to happen)
You may see that the user has joined the call twice. The console logs will show something like this:
Here you can see that call [1] has reconnected after leaving.
Expected behavior
Leaving the call happens cleanly and it does not reconnect.
Screenshots
Here you can see that the user has connected twice, because call reconnected after leaving:
Version
SDK version 1.8.1
React / JS client
Browser: Edge 131.0.2903.86
(I experienced the issue in all browsers, but seems to happen more consistently in edge for me)
Node JS client
Node version: v20.16.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Which package/packages do you use?
@stream-io/video-react-sdk
@stream-io/video-react-native-sdk
@stream-io/video-client
Describe the bug
Call will sometimes reconnect after leaving. For me this happens in React development mode when double render causes
useEffect
to join and leave a call in quick succession (see snippet below foruseEffect
logic).To Reproduce
Here you can see that call [1] has reconnected after leaving.
Expected behavior
Leaving the call happens cleanly and it does not reconnect.
Screenshots
Here you can see that the user has connected twice, because call reconnected after leaving:
Version
React / JS client
(I experienced the issue in all browsers, but seems to happen more consistently in edge for me)
Node JS client
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: