client-sdk-android
                                
                                 client-sdk-android copied to clipboard
                                
                                    client-sdk-android copied to clipboard
                            
                            
                            
                        Unable to Connect to Different LiveKit Session After Disconnecting Using Same Room Instance
Describe the bug
An issue is occurring when using LiveKit.create(context) to create a room, applying ReconnectType.FORCE_FULL_RECONNECT, and injecting this room into our manager.
The bug manifests when disconnecting from the room after a prior connection, where we are unable to connect to a different LiveKit session using the same room instance. This is excepted when attempting to reconnect the room after a delay of a few seconds. The event stream of the room delivers a "Disconnected" event with a null error and a "CLIENT_INITIATED" reason when we attempt to connect to a new session for the first time after the disconnection.
LiveKit.create(context).apply {
  setReconnectionType(ReconnectType.FORCE_FULL_RECONNECT)
}
Steps to Reproduce
- Create a room instance using the code above.
- Connect to a LiveKit session.
- Disconnect from that session.
- Attempt to connect to a different LiveKit session using the same room instance.
Expected Behavior
The expected behavior is to successfully connect to the different LiveKit session using the same room instance.
Device Info:
- Device: Google Pixel 4
- OS: Android 13
- LiveKit SDK version: v1.2.1
Additional Context
This issue seems similar to a previously reported bug that has been closed. As the problem still persists, I've opened this new issue.
As a temporary workaround, creating a new room instance for each new connection is possible, but this solution seems inefficient and doesn't align well with our project's architecture. Any assistance in addressing this issue would be greatly appreciated.
ReconnectType.FORCE_FULL_RECONNECT is only there as a debug option for our own testing purposes; it's not intended to be used in production (it makes the reconnection process to a server more inefficient).
Does this issue still happen without the setReconnectType call?
Ive tried it without ReconnectType.FORCE_FULL_RECONNECT and I can still not connect and get a CLIENT_INITIATED reason in the disconnect event