Skip to content

Disconnect the room not properly called "Cleanup RTC" and "room.cleanUpParticipants". #583

Closed
@ChandruContus

Description

@ChandruContus

when I disconnect the room "cleanUpRTC()" " cleanUpParticipants(isFullReconnect: isFullReconnect)" frequently not called. So "track.stop() " not working and again join the room video and audio not rendered. But green dot show in top on status bar.

Livekit SDK Verision : 2.0.19

func cleanUp(withError disconnectError: Error? = nil,
isFullReconnect: Bool = false) async
{
log("withError: (String(describing: disconnectError)), isFullReconnect: (isFullReconnect)")

    // Reset completers
    _sidCompleter.reset()
    primaryTransportConnectedCompleter.reset()
    publisherTransportConnectedCompleter.reset()

    await signalClient.cleanUp(withError: disconnectError)

------------below function not called-----------

    await cleanUpRTC()
    await cleanUpParticipants(isFullReconnect: isFullReconnect)

    // Cleanup for E2EE
    if let e2eeManager {
        e2eeManager.cleanUp()
    }

    // Reset state
    _state.mutate {
        // if isFullReconnect, keep connection related states
        $0 = isFullReconnect ? State(
            connectOptions: $0.connectOptions,
            roomOptions: $0.roomOptions,
            url: $0.url,
            token: $0.token,
            nextReconnectMode: $0.nextReconnectMode,
            isReconnectingWithMode: $0.isReconnectingWithMode,
            connectionState: $0.connectionState
        ) : State(
            connectOptions: $0.connectOptions,
            roomOptions: $0.roomOptions,
            connectionState: .disconnected,
            disconnectError: LiveKitError.from(error: disconnectError)
        )
    }
}

}

Console log:

2025-02-09 20:09:53.225086+0530 SampleAppKit[1129:51643] [websocket] Read completed with an error Operation canceled
2025-02-09 20:09:53.248411+0530 SampleAppKit[1129:51645] [tcp] tcp_input [C5.1:3] flags=[R] seq=2381814154, ack=0, win=0 state=CLOSED rcv_nxt=2381814154, snd_una=1187171602

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions