这是indexloc提供的服务,不要输入任何密码
Skip to content

[bug] Disconnection is impossible at connectivity lost #799

@aeri

Description

@aeri

Describe the bug

Given a correct flow of connection to a room and publication of audio and video tracks, if the connection is lost and at that moment the disconnect action to the room is invoked with room.disconnect(), the room will be blocked indefinitely with no possibility of disconnection, whether or not the Internet connection is reestablished.

To Reproduce

Occurs on disconnection attempt flow after loss of internet connection, can be verified using the sample app included with the library.

Expected behavior

It is a very common scenario that, given the loss of connectivity, it is desired to close and terminate the communication; this should be possible at any time, whether or not there is Internet connectivity; however, this bug presents a scenario in which the room will remain permanently active and without the possibility of closing it properly.

Platform information

  • Flutter version: Flutter version 3.29.2 on channel stable
  • Plugin version: 2.4.7
  • Flutter target OS: Android
  • Flutter target OS version: 14
  • Flutter console log:

The Log shows a loss of connectivity and two consecutive attempts to disconnect from the room:

2025-06-03 17:41:23.375  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4004 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 6826 us. Average swapBuffer time: 8640 us.
2025-06-03 17:41:23.538  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:23.576  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4010 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 1240 us. Average swapBuffer time: 11136 us.
2025-06-03 17:41:24.417  7886-8013  org.webrtc.Logging      io.livekit.example                   I  NetworkMonitorAutoDetect: Network handle: 450082295821, 104 is disconnected
2025-06-03 17:41:24.456  7886-7886  org.webrtc.Logging      io.livekit.example                   I  NetworkMonitorAutoDetect: Network connectivity changed, type is: CONNECTION_NONE
2025-06-03 17:41:24.557  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:24.931  7886-7886  flutter                 io.livekit.example                   I  15:41:24: lost connectivity
2025-06-03 17:41:24.931  7886-7886  flutter                 io.livekit.example                   I  15:41:24: lost connectivity
2025-06-03 17:41:24.932  7886-7886  flutter                 io.livekit.example                   I  15:41:24: [SignalEvent] Instance of 'SignalConnectivityChangedEvent'
2025-06-03 17:41:24.933  7886-7886  flutter                 io.livekit.example                   I  15:41:24: [SignalEvent] Instance of 'SignalConnectivityChangedEvent'
2025-06-03 17:41:25.152  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:25.564  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:26.573  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:27.157  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:27.379  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4003 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 9451 us. Average swapBuffer time: 7543 us.
2025-06-03 17:41:27.600  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:27.639  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4063 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.4. Average render time: 1838 us. Average swapBuffer time: 12034 us.
2025-06-03 17:41:28.608  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:29.158  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:29.280  7886-7886  flutter                 io.livekit.example                   I  15:41:29: [EngineEvent] Engine#1068919483 Instance of 'EngineClosingEvent'
2025-06-03 17:41:29.623  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:30.623  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:30.946  7886-7956  FlutterWebRTCPlugin     io.livekit.example                   D  onConnectionChangeDISCONNECTED
2025-06-03 17:41:30.947  7886-7886  flutter                 io.livekit.example                   I  15:41:30: subscriber iceConnectionState: RTCIceConnectionState.RTCIceConnectionStateDisconnected
2025-06-03 17:41:30.948  7886-7886  flutter                 io.livekit.example                   I  15:41:30: subscriber connectionState: RTCPeerConnectionState.RTCPeerConnectionStateDisconnected
2025-06-03 17:41:30.949  7886-7886  flutter                 io.livekit.example                   I  15:41:30: handleDisconnect: engine is closed, skip
2025-06-03 17:41:30.949  7886-7886  flutter                 io.livekit.example                   I  15:41:30: [EngineEvent] Engine#1068919483 EngineSubscriberPeerStateUpdatedEvent(state: RTCPeerConnectionState.RTCPeerConnectionStateDisconnected, isPrimary: true)
2025-06-03 17:41:31.102  7886-7956  FlutterWebRTCPlugin     io.livekit.example                   D  onConnectionChangeDISCONNECTED
2025-06-03 17:41:31.103  7886-7886  flutter                 io.livekit.example                   I  15:41:31: publisher iceConnectionState: RTCIceConnectionState.RTCIceConnectionStateDisconnected
2025-06-03 17:41:31.107  7886-7886  flutter                 io.livekit.example                   I  15:41:31: publisher connectionState: RTCPeerConnectionState.RTCPeerConnectionStateDisconnected
2025-06-03 17:41:31.110  7886-7886  flutter                 io.livekit.example                   I  15:41:31: handleDisconnect: engine is closed, skip
2025-06-03 17:41:31.111  7886-7886  flutter                 io.livekit.example                   I  15:41:31: [EngineEvent] Engine#1068919483 EnginePublisherPeerStateUpdatedEvent(state: RTCPeerConnectionState.RTCPeerConnectionStateDisconnected, isPrimary: false)
2025-06-03 17:41:31.159  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:31.381  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4002 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 6589 us. Average swapBuffer time: 9363 us.
2025-06-03 17:41:31.637  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:31.648  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4009 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 2244 us. Average swapBuffer time: 10911 us.
2025-06-03 17:41:32.645  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:33.161  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:33.658  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:34.670  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:35.119  7886-7886  flutter                 io.livekit.example                   I  15:41:35: ping timeout
2025-06-03 17:41:35.120  7886-7886  flutter                 io.livekit.example                   I  15:41:35: SignalClient did disconnect ConnectionState.connected
2025-06-03 17:41:35.122  7886-7886  flutter                 io.livekit.example                   I  15:41:35: [SignalEvent] Instance of 'SignalDisconnectedEvent'
2025-06-03 17:41:35.124  7886-7886  flutter                 io.livekit.example                   I  15:41:35: Signal disconnected DisconnectReason.disconnected
2025-06-03 17:41:35.162  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:35.384  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4002 ms. Frames received: 33. Dropped: 0. Rendered: 33. Render fps: 8.2. Average render time: 3577 us. Average swapBuffer time: 3888 us.
2025-06-03 17:41:35.650  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4002 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 1314 us. Average swapBuffer time: 6529 us.
2025-06-03 17:41:35.677  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:36.686  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:37.164  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:37.689  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:38.690  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:39.165  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:39.286  7886-7886  flutter                 io.livekit.example                   I  15:41:39: EventsListener<EngineEvent>#971132859 event was cancelled by func
2025-06-03 17:41:39.289  7886-7886  flutter                 io.livekit.example                   E  [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: LiveKit Exception: [TimeoutException] Timeout
                                                                                                    #0      EventsListenable.waitFor.<anonymous closure> (package:livekit_client/src/managers/event.dart:214:39)
                                                                                                    #1      _RootZone.run (dart:async/zone.dart:1843:54)
                                                                                                    #2      Future.timeout.<anonymous closure> (dart:async/future_impl.dart:1036:34)
                                                                                                    <asynchronous suspension>
                                                                                                    #3      EventsListenable.waitFor (package:livekit_client/src/managers/event.dart:212:14)
                                                                                                    <asynchronous suspension>
                                                                                                    #4      Room.disconnect (package:livekit_client/src/core/room.dart:631:5)
                                                                                                    <asynchronous suspension>
                                                                                                    #5      _ControlsWidgetState._onTapDisconnect (package:livekit_example/widgets/controls.dart:216:25)
                                                                                                    <asynchronous suspension>
2025-06-03 17:41:39.389  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4004 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 2817 us. Average swapBuffer time: 4341 us.
2025-06-03 17:41:39.653  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4002 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 1321 us. Average swapBuffer time: 3675 us.
2025-06-03 17:41:39.710  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:40.065  7886-7886  flutter                 io.livekit.example                   I  15:41:40: [SignalClient#501094614] Could not send message, socket not connected
2025-06-03 17:41:40.724  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:41.173  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:41.740  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:42.755  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:43.176  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 8.
2025-06-03 17:41:43.392  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4004 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 3300 us. Average swapBuffer time: 2894 us.
2025-06-03 17:41:43.658  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4004 ms. Frames received: 33. Dropped: 0. Rendered: 33. Render fps: 8.2. Average render time: 1092 us. Average swapBuffer time: 4098 us.
2025-06-03 17:41:43.756  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:44.759  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:45.071  7886-7886  flutter                 io.livekit.example                   I  15:41:45: [SignalClient#501094614] Could not send message, socket not connected
2025-06-03 17:41:45.177  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:45.774  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:45.957  7886-7886  flutter                 io.livekit.example                   I  15:41:45: Engine is already closed
2025-06-03 17:41:46.809  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API
2025-06-03 17:41:47.178  7886-7960  org.webrtc.Logging      io.livekit.example                   I  CameraStatistics: Camera fps: 9.
2025-06-03 17:41:47.395  7886-8484  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4002 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 6656 us. Average swapBuffer time: 4639 us.
2025-06-03 17:41:47.660  7886-7975  org.webrtc.Logging      io.livekit.example                   I  EglRenderer: Duration: 4001 ms. Frames received: 34. Dropped: 0. Rendered: 34. Render fps: 8.5. Average render time: 1305 us. Average swapBuffer time: 7158 us.
2025-06-03 17:41:47.822  7886-7912  libEGL                  io.livekit.example                   E  called unimplemented OpenGL ES API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions