Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: searchMessages function called repeatedly after typing stops in Search Messages component #650

Open
SinghaAnirban005 opened this issue Oct 31, 2024 · 1 comment · May be fixed by #655
Labels
bug Something isn't working

Comments

@SinghaAnirban005
Copy link

SinghaAnirban005 commented Oct 31, 2024

Description:

searchMessages function is invoked repeatedly after the user stops typing in the search Messages input box, causing multiple API calls, which may lead to increased server load and decreased performance.

Steps to reproduce:

  1. Click on the three dots at the header section -> Click on Search Messages
  2. Open the browser developer console -> search for some message
  3. In the Networks tab, you can see the Multiple API calls being made

Expected behavior:

After the user stops typing, searchMessages should be called only once after the specified debounce delay (e.g., 500ms).

Actual behavior:

After typing stops, searchMessages continues to be called repeatedly, resulting in multiple unnecessary API requests.

EmbeddedChat._.Simple.-.Simple.Storybook.-.Brave.2024-10-31.15-49-29.mp4
@SinghaAnirban005 SinghaAnirban005 added the bug Something isn't working label Oct 31, 2024
@SinghaAnirban005
Copy link
Author

I will be raising a PR soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment