Closed andreibazi closed 1 year ago
I can confirm this issue is easy to reproduce. This is because the Connect function first tries to open a user session (using the user name, external ID and avatar URL) and only then actually connects to a conference. When you disconnect and connect immediately it is possible (almost certain) that you will disconnect from the conference, but the session will still be open for a short while. This requires fixing some logic in when On Disconnected is triggered, so that it is only fired when the session is closed or a fatal conference error occurs.
@Adam1-3 FYI
@Adam1-3 We may also want to consider moving session.open out of Connect and session.close out of Disconnect somehow. For example if a user wants to quickly switch conferences by chaining Disconnect(old)->Connect(new), it is pointless to redo the session. Without breaking compatibility, we could for example save the user data and only open a new session if it changes.
@kubaau Thank you very much for the fast fix!
Describe the bug
When attempting to connect to a new conference from inside a method bound to the
OnDisconnected
event, the SDK returns an error:LogDolbyIO: Error: Caught dolbyio::comms::exception: Invalid session state: 2, required: 0 (conference status: destroyed, line: 383)
.Adding a
0.5
second delay after theOnDisconnected
event right before calling theConnect
method again stops the error from being thrown and things work as expected.This happens regardless of the implementation of the client logic (C++ or Blueprint).
Tested and reproduced on my end in Unreal Engine 5.1.1 using both the 1.1.0-beta.9 and 1.0.2 releases.
Expected Behavior
When
OnDisconnected
fires, the underlying SDK is fully ready for a new connection. Therefore, callingConnect
from inside a function bound toOnDisconnected
should work without throwing the error.Minimalistic code (recommended)
A sample UE 5.1.1 project repository demonstrating the issue can be found here.
To reproduce the issue without cloning the project:
Dolby.io Connect
node;Delay
+ aDolby.io Disconnect
node toOnConnected
, so that after 10 seconds you disconnect from the "main-conference";Dolby.io Disconnect
node, bind a newDolby.io Connect
node (that connects to a "sub-conference") directly to theOnDisconnected
pin;This will lead to the aforementioned error being thrown. Adding a delay between these two nodes (it can be a small 0.5s delay) fixes the issue.
Specifications
Engine log
Here is a log that includes the error/conference IDs for back-end checks.