This message was deleted.
# helpdesk
s
This message was deleted.
d
Can you share more about your environment? self-hosting the server? if so what software version? and which client SDK version?
n
Server: Cloud SDK: • "@livekit/react-native": "^1.4.1" • "@livekit/react-native-webrtc": "^114.0.0" I noticed that during the first connection attempt, there's always a disconnection. Below are the logs for the
onConnectionStateChanged
event:
Copy code
'onConnectionStateChanged', 'connecting'
'onConnectionStateChanged', 'connecting'
'onConnectionStateChanged', 'connected'
'onConnectionStateChanged', 'disconnected'
'onConnectionStateChanged', 'connected'
Logs:
Copy code
'conected to ', '<wss://ciaoamigos-0t0ghmre.livekit.cloud>', ' ', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDM5ODgwODUsImlzcyI6IkFQSVk3OEpzbk1OQlJReiIsIm5iZiI6MTcwMzA4ODA4NSwic3ViIjoiUElQUE8iLCJ2aWRlbyI6eyJjYW5QdWJsaXNoIjp0cnVlLCJjYW5QdWJsaXNoRGF0YSI6dHJ1ZSwiY2FuU3Vic2NyaWJlIjp0cnVlLCJyb29tIjoiVEVTVCIsInJvb21Kb2luIjp0cnVlfX0.CTf_ZtfwApgBCU08XcV3lugkZ2qwEkjBA4M0qwuEWWE'
2023-12-21T15:29:20.006Z
48685
newproject
'isPublishingTrack', false
2023-12-21T15:29:21.750Z
48685
newproject
Possible Unhandled Promise Rejection (id: 0):
Error: addIceCandidate failed
promiseMethodWrapper@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.bbrmonza.it:2055:45
@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.
2023-12-21T15:29:21.752Z
48685
newproject
Possible Unhandled Promise Rejection (id: 1):
Error: addIceCandidate failed
promiseMethodWrapper@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.bbrmonza.it:2055:45
@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.
2023-12-21T15:29:21.753Z
48685
newproject
Possible Unhandled Promise Rejection (id: 2):
Error: addIceCandidate failed
promiseMethodWrapper@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.bbrmonza.it:2055:45
@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.
2023-12-21T15:29:21.754Z
48685
newproject
Possible Unhandled Promise Rejection (id: 3):
Error: addIceCandidate failed
promiseMethodWrapper@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.bbrmonza.it:2055:45
@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.
2023-12-21T15:29:21.756Z
48685
newproject
Possible Unhandled Promise Rejection (id: 4):
Error: PeerConnection cannot create an answer in a state other than have-remote-offer or have-local-pranswer.
promiseMethodWrapper@http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=myjobsvil.bbrmonza.it:2055:45
@http://localhost:8081/index.bundle//&platform=ios&
My code for the connection:
Copy code
let connect = async () => {
  const connectOpts = {
    rtcConfig: {
      iceTransportPolicy: 'relay',
    },
  };

  try {
    await room.connect(liveKitUrl, liveKitToken, connectOpts);
    // ...Other processes after connection
    console.log('Connected to', liveKitUrl, liveKitToken);
  } catch (error) {
    console.error('Error during connection:', error);
  }
};
await connect();
It's noticed that during the initial connection attempt, after the state appears as "connected," an immediate disconnection occurs with the "Connection refused" error. I've set
iceTransportPolicy
to "relay" in an attempt to resolve this issue, but it seems the connection continues to be refused. Any suggestions on how to handle this issue would be greatly appreciated. Thank you!
d
hmm how could we get a repro on our side? this seems rather basic
n
Thank you, I'm attaching a copy of the application on Git. All the logic is within 'useLiveKitConnection'. The connection is shared throughout the application using LiveKitContext. Url git: https://github.com/ciaoamigoschat/LIvekkitest
Hi David, sorry to bother you. I'm writing to ask if you've seen my repository.