GetStream / stream-chat-react

React Chat SDK ➜ Stream Chat 💬
https://getstream.io/chat/sdk/react/
Other
698 stars 272 forks source link

question: Channel List Component Reaches Rate Limit Due to QueryChannel for Each New Channel on Campaign Creation #2441

Open LongJohnSilver1504 opened 2 months ago

LongJohnSilver1504 commented 2 months ago

Hello there:

When a campaign is created with thousands of users, the Channel List component starts to perform a queryChannel for each newly created channel. This behavior causes the application to quickly reach the rate limit, particularly in the view of the user who creates the campaign.

Steps to Reproduce:

1.  Create a campaign with a large number of users (e.g., thousands).
2.  Observe the Channel List component’s behavior in the user’s view who created the campaign.
3.  Notice that a queryChannel is triggered for each new channel created, leading to rapid rate limit exhaustion.

Current Behavior: The Channel List component makes a queryChannel request for every newly created channel, which is not scalable for campaigns with a large number of users.

How I could solve this problem?

Thanks

MartinCupela commented 2 months ago

Hello @LongJohnSilver1504 how do you create campaigns? Do you create them client-side or server-side?

LongJohnSilver1504 commented 2 months ago

Hi @MartinCupela I created the campaign on the server.

Im just investigating and after the campaign creation the event

notification.message_new | Moves channel to top of list and starts watching | onMessageNew

is called for every campaign message on the sender chat view

and here is the problem

Now Im just trying to debounce or something

MartinCupela commented 2 months ago

Hey @LongJohnSilver1504 , please give me some time to clarify this with the team.

LongJohnSilver1504 commented 2 months ago

Perfect @MartinCupela I also explain the problem to Anders Lund from support ;)

MartinCupela commented 2 months ago

Hello @LongJohnSilver1504 , the issue is now taken care of by our back-end team. I will keep you updated.