AgoraIO-Community / AgoraWebSDK-NG

The Next Generation of Agora Web SDK
https://agoraio-community.github.io/AgoraWebSDK-NG/
161 stars 74 forks source link

If a user for some reason has some network restrictions, then the client keeps on trying to join infinitely. #144

Open tsyrya opened 3 years ago

tsyrya commented 3 years ago

Describe the bug

If a user for some reason has some network restrictions, then the client keeps on trying to join infinitely. Is there a way to interrupt the process or set some sort of timeout for the attempts?

SDK Logs

13:07:19:300 Agora-SDK [DEBUG]: [client-5db35] new Session 209D1B534778DA0BA65C36F15A0122CB AgoraRTC_N-production.js?e671:374 POST https://sua-ap-web-1.agora.io/api/v1?action=stringuid net::ERR_INTERNET_DISCONNECTED AgoraRTC_N-production.js?e671:374 POST https://statscollector-1.agora.io:6443/events/messages net::ERR_INTERNET_DISCONNECTED AgoraRTC_N-production.js?e671:374 POST https://statscollector-1.agora.io:6443/events/messages net::ERR_INTERNET_DISCONNECTED ....

Channel:
39ef9b84-f233-41af-ab94-3f07c45d9112@

UID:
"1"

Platform and Browser:
macOS, Chrome 90

SDK Version:
4.4.0

To Reproduce

Steps to reproduce the behavior:

  1. put debugger before the join call
  2. When the browser stops for debugging before the join call, turn off the network
  3. Allow js to run the code furtherly
  4. The connection error would be printing infinitely, but the code would be stuck waiting for the join promises to be resolved or rejected, which doesn't happen.
tsyrya commented 3 years ago

Well, I found the httpRetryConfig option. It helps, the client throws an exception after some time, but it continues sending requests like that: https://web-2.statscollector.sd-rtn.com:6443/events/messages. How can I stop it?

Also, could please you clarify the meaning of the options in the RetryConfig interface?