AgoraIO-Community / AgoraWebSDK-NG

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

Sending too many requests to webcollector url #94

Open nurishi opened 4 years ago

nurishi commented 4 years ago

Describe the bug

SDK seems sending too many requests to webcollector url, if you repeatedly join and leave from channel. Feels like it's not safely clearing the timer for sending report process so it keeps increasing exponentially.

We have an usecase for users to join one channel to another, and in this case, even one user can easily start invoking thousands of requests at a time without knowing it. It can harm Agora server as well as browser process so I hope it to be fixed very soon.

Platform and Browser: Chrome 86 SDK Version: 4.1.0

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://agoraio-community.github.io/AgoraWebSDK-NG/demo/basicVideoCall/index.html'
  2. Click on 'Join' and 'Leave' repeatedly (probably more than 10 times to see the issue clearly)
  3. See DevConsole Network tab

Additional context

image

You can see a total number of requests which has been sent at left bottom corner of the screenshot. In this case, I stopped trying here but one day when I was debugging this issue, it was sending like 10k requests at a time.

HAHAHA44 commented 4 years ago

Thanks for your attention. This is a bug of SDK, we will fix it in next version. By the way, If you want to join channel and leave channel multiple times, you should reuse the previous client. So we will also optimize our demo.

// the client should be reused
const client = AgoraRTC.createClient({ mode: "rtc", codec: "vp8" });

// your join function
const join = () => {};
nurishi commented 4 years ago

@HAHAHA44 Thanks for your reply. And noted for your advice to re-use the client.

Sorry for asking but any expected timeline(roughly) for next version release? This is kinda blocker for us now but we'll try re-using the client and see if that helps.