Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]RoomDisconnectedEvent Triggered Twice with Different Reasons #626

Open
AoEiuV020 opened this issue Nov 4, 2024 · 1 comment
Open

Comments

@AoEiuV020
Copy link
Contributor

Describe the bug
I encountered an issue where the RoomDisconnectedEvent is triggered twice with different reasons when calling room.disconnect().

To Reproduce

Steps to reproduce:
run example app,
Navigate to the room page.
Click the button to disconnect, which calls room.disconnect().
Expected behavior
The RoomDisconnectedEvent should only be triggered once upon disconnection, with a consistent event.reason.

Observed behavior
The RoomDisconnectedEvent is triggered twice, with each instance showing a different reason:
First event: DisconnectReason.disconnected
Second event: DisconnectReason.clientInitiated

Platform information

  • Flutter version: 3.24.4
  • Plugin version:master e9d3d2b
  • Flutter target OS: windows
  • Flutter target OS version: 11
  • Flutter console log:

[ERROR:flutter/shell/common/shell.cc(1065)] The 'FlutterWebRTC/dataChannelEventF3053313-10EE-427C-B6F8-81B6EA7015137C7A2D97-5E46-441E-9A21-59A89DE04877' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.
See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.
2
flutter: 12:30:32: [EngineEvent] Engine#821414078 Instance of 'PublisherDataChannelStateUpdatedEvent'
2
flutter: 12:30:32: [EngineEvent] Engine#821414078 Instance of 'SubscriberDataChannelStateUpdatedEvent'
flutter: 12:30:43: publisher iceConnectionState: RTCIceConnectionState.RTCIceConnectionStateDisconnected
3
flutter: 12:30:43: [EngineEvent] Engine#821414078 Instance of 'PublisherDataChannelStateUpdatedEvent'
2
flutter: 12:30:43: [EngineEvent] Engine#821414078 Instance of 'SubscriberDataChannelStateUpdatedEvent'
flutter: 12:30:43: [EngineEvent] Engine#821414078 Instance of 'PublisherDataChannelStateUpdatedEvent'
2
flutter: 12:30:43: [EngineEvent] Engine#821414078 Instance of 'SubscriberDataChannelStateUpdatedEvent'
flutter: 12:30:43: [SignalEvent] Instance of 'SignalLeaveEvent'
flutter: 12:30:43: updating regions
flutter: 12:30:43: [SignalClient#694261592] cleanUp()
flutter: 12:30:43: [Engine#821414078] cleanUp()
flutter: 12:30:43: SignalClient did disconnect ConnectionState.disconnected
flutter: 12:30:43: [SignalEvent] Instance of 'SignalDisconnectedEvent'
flutter: 12:30:43: [SignalClient#694261592] cleanUp()
flutter: 12:30:43: [EngineEvent] Engine#821414078 Instance of 'EngineDisconnectedEvent'
flutter: 12:30:43: [Room#763362320] cleanUp()
flutter: 12:30:43: RemoteAudioTrack#505888691 onDispose()
flutter: 12:30:43: RemoteAudioTrack#505888691.stop()
flutter: 12:30:43: RemoteAudioTrack#505888691.disable() disabling MediaStreamTrackNative#446673114...
flutter: 12:30:43: EventsListener#1007231273 event was cancelled by func
flutter: 12:30:43: [Room#763362320] cleanUp()
flutter: 12:30:43: onAudioTrackCountDidChange: local: 1, remote: 0
flutter: 12:30:43: didUpdateSate: AudioTrackState.localOnly
flutter: 12:30:43: RemoteVideoTrack#6871159 onDispose()
flutter: 12:30:43: RemoteVideoTrack#6871159.stop()
flutter: 12:30:43: RemoteVideoTrack#6871159.disable() disabling MediaStreamTrackNative#842528056...
flutter: 12:30:43: Signal disconnected DisconnectReason.disconnected
flutter: 12:30:43: [EngineEvent] Engine#821414078 Instance of 'EngineDisconnectedEvent'
flutter: 12:30:43: [Room#763362320] cleanUp()
flutter: 12:30:43: failed to emit event TrackUnsubscribedEvent(participant: RemoteParticipant(sid: PA_soadztwnMNeN, identity: skpc__mw21), publication: RemoteTrackPublication(sid: TR_AMwhAoTBgD3hGo, source: TrackSource.microphone), track: Instance of 'RemoteAudioTrack') on a disposed emitter
flutter: 12:30:43: [RemoteTrackPublication#7990154] unnecessary dispose() called.
flutter: 12:30:43: Publication not found TR_VCVKojPtg8QEfA
flutter: 12:30:43: failed to emit event TrackUnsubscribedEvent(participant: RemoteParticipant(sid: PA_soadztwnMNeN, identity: skpc__mw21), publication: RemoteTrackPublication(sid: TR_VCVKojPtg8QEfA, source: TrackSource.camera), track: Instance of 'RemoteVideoTrack') on a disposed emitter
flutter: 12:30:43: [RemoteTrackPublication#413603322] unnecessary dispose() called.
2
flutter: 12:30:43: [RemoteParticipant#1058203692] unnecessary dispose() called.
flutter: 12:30:43: LocalAudioTrack#222494135 onDispose()
flutter: 12:30:43: LocalAudioTrack#222494135.stop()
flutter: 12:30:43: Stopping mediaStreamTrack...
flutter: 12:30:43: LocalVideoTrack#387561859 onDispose()
flutter: 12:30:43: LocalVideoTrack#387561859.stop()
flutter: 12:30:43: Stopping mediaStreamTrack...
flutter: 12:30:43: [Engine#821414078] cleanUp()
flutter: 12:30:43: [SignalClient#694261592] cleanUp()
flutter: 12:30:43: LocalAudioTrack#222494135.unpublish()
flutter: 12:30:43: onAudioTrackCountDidChange: local: 0, remote: 0
flutter: 12:30:43: didUpdateSate: AudioTrackState.none
flutter: 12:30:43: failed to emit event LocalTrackUnpublishedEvent(participant: LocalParticipant(sid: PA_jpvmqADrwoTw, identity: skpc__4sfb), publication: LocalTrackPublication(sid: TR_AMTcyRY6eqH8Mp, source: TrackSource.microphone)) on a disposed emitter
flutter: 12:30:43: [LocalTrackPublication#809472897] unnecessary dispose() called.
flutter: 12:30:43: Publication not found TR_VCFRFqAGTN4C2n
flutter: 12:30:43: [Engine#821414078] cleanUp()
flutter: 12:30:43: [SignalClient#694261592] cleanUp()
flutter: Room disconnected: reason => DisconnectReason.disconnected
flutter: 12:30:43: LocalVideoTrack#387561859.unpublish()
flutter: 12:30:43: failed to emit event LocalTrackUnpublishedEvent(participant: LocalParticipant(sid: PA_jpvmqADrwoTw, identity: skpc__4sfb), publication: LocalTrackPublication(sid: TR_VCFRFqAGTN4C2n, source: TrackSource.camera)) on a disposed emitter
flutter: 12:30:43: [LocalTrackPublication#871818032] unnecessary dispose() called.
flutter: 12:30:43: [Engine#821414078] cleanUp()
flutter: 12:30:43: [SignalClient#694261592] cleanUp()
flutter: Room disconnected: reason => DisconnectReason.clientInitiated
4
flutter: 12:30:43: called removeListener() on a disposed ChangeNotifier
flutter: 12:30:44: [Room#763362320] cleanUp()
flutter: 12:30:44: [Engine#821414078] cleanUp()
flutter: 12:30:44: [SignalClient#694261592] cleanUp()
flutter: 12:30:44: [Engine#821414078] cleanUp()
flutter: 12:30:44: [SignalClient#694261592] cleanUp()
Application finished.

@AoEiuV020
Copy link
Contributor Author

The server in use is the official LiveKit demo: https://meet.livekit.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant