Skip to content

[bug] app intermintently crashes/stucks on connect to room when E2EE enabled on iOS #652

Closed
@aeri

Description

@aeri

Describe the bug

When using end-to-end encryption (e2ee) on iOS, the application crashes completely. The problem occurs intermittently and always happens after invoke room.connect().

To Reproduce

Using the sample application and activating E2EE on iOS sometimes the interface crashes and the application stops responding completely.

Expected behavior
The room session should be established without problems
Platform information

  • Flutter version: Channel stable, 3.22.2
  • Plugin version: 2.3.1+hotfix.1
  • Flutter target OS: iOS
  • Flutter target OS version: 17.5.1
  • Flutter console log:
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTokenUpdatedEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalOfferEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: EventsListener<SignalEvent>#809715491 event was cancelled by func
flutter: 15:58:32: Waiting for engine to connect...
flutter: 15:58:32: Server refreshed the token
flutter: 15:58:32: [Engine#411520319] Received server offer(type: offer, RTCSignalingState.RTCSignalingStateStable)
flutter: 15:58:32: Created answer
flutter: 15:58:32: got ICE candidate from peer (target: SUBSCRIBER)
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: got ICE candidate from peer (target: SUBSCRIBER)
flutter: 15:58:32: subscriber connectionState: RTCPeerConnectionState.RTCPeerConnectionStateConnecting
flutter: 15:58:32: [EngineEvent] Engine#411520319 EngineSubscriberPeerStateUpdatedEvent(state: RTCPeerConnectionState.RTCPeerConnectionStateConnecting, isPrimary: true)
flutter: 15:58:32: subscriber iceConnectionState: RTCIceConnectionState.RTCIceConnectionStateChecking
flutter: 15:58:32: got ICE candidate from peer (target: SUBSCRIBER)
flutter: 15:58:32: got ICE candidate from peer (target: SUBSCRIBER)
flutter: 15:58:32: [SignalEvent] Instance of 'SignalLocalTrackPublishedEvent'
flutter: 15:58:32: EventsListener<SignalEvent>#809715491 event was cancelled by func
flutter: 15:58:32: LocalAudioTrack#857737181.publish()
flutter: 15:58:32: onAudioTrackCountDidChange: local: 1, remote: 0
flutter: 15:58:32: didUpdateSate: AudioTrackState.localOnly
flutter: 15:58:32: configuring for AudioTrackState.localOnly using Instance of 'NativeAudioConfiguration'...
flutter: 15:58:32: [SignalEvent] Instance of 'SignalLocalTrackPublishedEvent'
flutter: 15:58:32: EventsListener<SignalEvent>#809715491 event was cancelled by func
flutter: 15:58:32: publishVideoTrack addTrack response: sid: ***
type: VIDEO
name: camera
width: 1280
height: 720
source: CAMERA
layers: {
  width: 320
  height: 180
  bitrate: 160000
}
layers: {
  quality: MEDIUM
  width: 640
  height: 360
  bitrate: 450000
}
layers: {
  quality: HIGH
  width: 1280
  height: 720
  bitrate: 5000000
}
codecs: {
  mimeType: video/VP8
  cid: 7F509F6B-FB86-4CBF-B638-49BCAB9C420C
  layers: {
    width: 320
    height: 180
    bitrate: 160000
  }
  layers: {
    quality: MEDIUM
    width: 640
    height: 360
    bitrate: 450000
  }
  layers: {
    quality: HIGH
    width: 1280
    height: 720
    bitrate: 5000000
  }
}
encryption: GCM
stream: camera
flutter: 15:58:32: requested a different codec than specified by serverRequested: preferred codec, server: vp8
flutter: 15:58:32: publishVideoTrack publisher: Instance of 'Transport'
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: subscriber onIceCandidate
flutter: 15:58:32: starting to negotiate
flutter: 15:58:32: get capabilities [Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability', Instance of 'RTCRtpCodecCapability']
flutter: 15:58:32: setting munged local
flutter: 15:58:32: _addRtpSender, setKeyIndex: 0
flutter: 15:58:32: LocalVideoTrack#67571778.publish()
flutter: 15:58:32: publisher onOffer
flutter: 15:58:32: [SignalEvent] Instance of 'SignalAnswerEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: received answer (type: answer)
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:32: [SignalEvent] Instance of 'SignalTrickleEvent'
flutter: 15:58:33: [SignalEvent] Instance of 'SignalParticipantUpdateEvent'
flutter: 15:58:36: [SignalEvent] Instance of 'SignalConnectionQualityUpdateEvent'
flutter: 15:58:36: [SignalEvent] Instance of 'SignalRoomUpdateEvent'
flutter: 15:58:42: EventsEmitter<EngineEvent>#336362232 event was cancelled by func
flutter: 15:58:42: Connect Error LiveKit Exception: [MediaConnectException] Timed out waiting for PeerConnection to connect, please check your network for ice connectivity
flutter: 15:58:42: could not connect to wss://****-****.livekit.cloud LiveKit Exception: [MediaConnectException] Timed out waiting for PeerConnection to connect, please check your network for ice connectivity
flutter: Could not connect LiveKit Exception: [MediaConnectException] Timed out waiting for PeerConnection to connect, please check your network for ice connectivity
flutter: 15:58:42: [EngineEvent] Engine#411520319 Instance of 'EngineDisconnectedEvent'
flutter: 15:58:42: [Room#30122265] cleanUp()
flutter: 15:58:42: LocalAudioTrack#857737181 onDispose()
flutter: 15:58:42: LocalAudioTrack#857737181.stop()
flutter: 15:58:42: Stopping mediaStreamTrack...
flutter: 15:58:47: SignalClient did disconnect ConnectionState.connected
flutter: 15:58:47: [SignalEvent] Instance of 'SignalDisconnectedEvent'
flutter: 15:58:52: [SignalClient#311986490] Could not send message, socket not connected
flutter: 15:58:57: [SignalClient#311986490] Could not send message, socket not connected
flutter: 15:59:02: [SignalClient#311986490] Could not send message, socket not connected
flutter: 15:59:02: ping timeout
flutter: 15:59:02: SignalClient did disconnect ConnectionState.disconnected
flutter: 15:59:02: [SignalEvent] Instance of 'SignalDisconnectedEvent'
flutter: 15:59:07: [SignalClient#311986490] Could not send message, socket not connected
flutter: 15:59:12: [SignalClient#311986490] Could not send message, socket not connected
flutter: 15:59:17: [SignalClient#311986490] Could not send message, socket not connected

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