team-telnyx / flutter-voice-sdk

Telnyx Flutter WebRTC SDK - Enable real-time communication with WebRTC and Telnyx
MIT License
11 stars 5 forks source link

[Bug] Logging in after connecting telnyx causes LateInitialization error #26

Open icodelifee opened 1 year ago

icodelifee commented 1 year ago

Bug Category

SDK Version telnyx_webrtc: latest

Describe the bug No, it does not occur in the example app because the example does not log in right after you connect the client. I had this issue for a long time and the workaround I did to fix it was using a delay of 4 seconds to log in after you connect the client because the connect() method is not asynchronous, but in release the delay is not really working and users are not able to automatically login into the client. Screenshot 2022-10-26 at 4 52 44 PM

Expected behaviour A clear and concise description of what you expected to happen.

Logs Please provide any logs available to you, remember to enable verbose logging within the SDK.

icodelifee commented 1 year ago

logs: https://katb.in/imumumesagi

mohsinnaqvi606 commented 1 year ago

Same Issue... still no solution

icodelifee commented 1 year ago

Same Issue... still no solution

Did you try connecting after a delay?

mohsinnaqvi606 commented 1 year ago

solved It

this error comes when you try to connect client and login simultaneously. just connect client first and after some delay try to login. there will be no error

Cheeers

icodelifee commented 1 year ago

solved It

this error comes when you try to connect client and login simultaneously. just connect client first and after some delay try to login. there will be no error

Cheeers

Its not really a solution, its a workaround

mohsinnaqvi606 commented 1 year ago

you can not login until client is not connected & client it will take some time to connect. so you have to wait for client connection

icodelifee commented 1 year ago

you can not login until client is not connected & client it will take some time to connect. so you have to wait for client connection

Yes i know that, ive been doing that ever since i opened this issue, but you might still run into connection issues, if you have a poor network or slow device.

mohsinnaqvi606 commented 1 year ago

yes, it will be an error in that case. because there is no way to detect whether a connection is established on not.

gada-raj commented 2 months ago

Make the connect function Asynchronous so we can wait for it and then call the login function.