[GH-ISSUE #5556] [bug]: Search bar triggers API calls on every keystroke instead of using debounce #2143

Open
opened 2026-03-16 23:21:27 +03:00 by kerem · 8 comments
Owner

Originally created by @TZ-TawfiqSirajudeen on GitHub (Nov 3, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5556

Originally assigned to: @soumyamakkar on GitHub.

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Web App

Browser

Chrome

Operating System

Windows

Bug Description

Bug Report: Search bar triggers API calls on every keystroke instead of using debounce

Description

The search bar currently sends an API request for every single keystroke the user types.
This results in excessive network calls, increased server load, and slower overall performance, especially for users on slower networks or with larger datasets.

A debounce mechanism should be implemented to delay the API call until the user stops typing for a short duration (e.g., 300–500ms). This will significantly improve performance and user experience.

Steps to Reproduce

Navigate to the page or component that includes the search bar.

Begin typing any query (e.g., “apple”).

Open the network tab in browser developer tools.

Observe that an API call is triggered on each keypress (e.g., typing “apple” results in 5 API calls).

Expected Behavior

The search input should use debounce to make only one API call after the user pauses typing for a short time (e.g., 300–500ms).

Actual Behavior

The application currently sends an API request on every keystroke, causing performance degradation and unnecessary server requests.

Impact

High number of redundant API requests

Increased load on backend services

Slower user interface response times

Poor user experience on slower connections

Suggested Fix

Implement a debounce function for the search input handler.
Example (using JavaScript/TypeScript):

let debounceTimer: ReturnType;

const handleSearchInput = (query: string) => {
clearTimeout(debounceTimer);
debounceTimer = setTimeout(() => {
fetchSearchResults(query);
}, 400); // delay in ms
};

Deployment Type

Hoppscotch Cloud

Version

No response

Originally created by @TZ-TawfiqSirajudeen on GitHub (Nov 3, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5556 Originally assigned to: @soumyamakkar on GitHub. ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Web App ### Browser Chrome ### Operating System Windows ### Bug Description Bug Report: Search bar triggers API calls on every keystroke instead of using debounce Description The search bar currently sends an API request for every single keystroke the user types. This results in excessive network calls, increased server load, and slower overall performance, especially for users on slower networks or with larger datasets. A debounce mechanism should be implemented to delay the API call until the user stops typing for a short duration (e.g., 300–500ms). This will significantly improve performance and user experience. Steps to Reproduce Navigate to the page or component that includes the search bar. Begin typing any query (e.g., “apple”). Open the network tab in browser developer tools. Observe that an API call is triggered on each keypress (e.g., typing “apple” results in 5 API calls). Expected Behavior The search input should use debounce to make only one API call after the user pauses typing for a short time (e.g., 300–500ms). Actual Behavior The application currently sends an API request on every keystroke, causing performance degradation and unnecessary server requests. Impact High number of redundant API requests Increased load on backend services Slower user interface response times Poor user experience on slower connections Suggested Fix Implement a debounce function for the search input handler. Example (using JavaScript/TypeScript): let debounceTimer: ReturnType<typeof setTimeout>; const handleSearchInput = (query: string) => { clearTimeout(debounceTimer); debounceTimer = setTimeout(() => { fetchSearchResults(query); }, 400); // delay in ms }; ### Deployment Type Hoppscotch Cloud ### Version _No response_
Author
Owner

@soumyamakkar commented on GitHub (Nov 4, 2025):

Hi, can I work on this issue?

<!-- gh-comment-id:3483925847 --> @soumyamakkar commented on GitHub (Nov 4, 2025): Hi, can I work on this issue?
Author
Owner

@soumyamakkar commented on GitHub (Nov 4, 2025):

I am unable to reproduce this bug. I only see an API call being made when I click on send. I have attached a screen recording below, please see if I am missing something.

https://github.com/user-attachments/assets/9fff0946-7dbe-4d58-ad4a-2dc06d2b1dfd

<!-- gh-comment-id:3486986906 --> @soumyamakkar commented on GitHub (Nov 4, 2025): I am unable to reproduce this bug. I only see an API call being made when I click on send. I have attached a screen recording below, please see if I am missing something. https://github.com/user-attachments/assets/9fff0946-7dbe-4d58-ad4a-2dc06d2b1dfd
Author
Owner

@nivedin commented on GitHub (Nov 5, 2025):

@soumyamakkar I believe the user was referring to the Spotlight search rather than the request URL input. Please confirm, @TZ-TawfiqSirajudeen.

<!-- gh-comment-id:3490061023 --> @nivedin commented on GitHub (Nov 5, 2025): @soumyamakkar I believe the user was referring to the Spotlight search rather than the request URL input. Please confirm, @TZ-TawfiqSirajudeen.
Author
Owner

@soumyamakkar commented on GitHub (Nov 5, 2025):

yes yes correct. I checked the issue in the spotlight search and was able to reproduce it..

<!-- gh-comment-id:3490305547 --> @soumyamakkar commented on GitHub (Nov 5, 2025): yes yes correct. I checked the issue in the spotlight search and was able to reproduce it..
Author
Owner

@TZ-TawfiqSirajudeen commented on GitHub (Nov 5, 2025):

Hi @soumyamakkar Hope you find out the bug , here I mentioned the screenshot

Image
<!-- gh-comment-id:3490341699 --> @TZ-TawfiqSirajudeen commented on GitHub (Nov 5, 2025): Hi @soumyamakkar Hope you find out the bug , here I mentioned the screenshot <img width="1324" height="60" alt="Image" src="https://github.com/user-attachments/assets/007366a1-e805-4959-a489-ba8cdff45e5e" />
Author
Owner

@soumyamakkar commented on GitHub (Nov 8, 2025):

hi @nivedin , I’m able to reproduce this bug on the production site, but when I run Hoppscotch locally, the “Documentation” section doesn’t appear in the Spotlight search, so I can’t trigger the same API calls. Just want to confirm the best way to proceed before implementing the debounce fix.

<!-- gh-comment-id:3506768093 --> @soumyamakkar commented on GitHub (Nov 8, 2025): hi @nivedin , I’m able to reproduce this bug on the production site, but when I run Hoppscotch locally, the “Documentation” section doesn’t appear in the Spotlight search, so I can’t trigger the same API calls. Just want to confirm the best way to proceed before implementing the debounce fix.
Author
Owner

@nivedin commented on GitHub (Nov 12, 2025):

hi @nivedin , I’m able to reproduce this bug on the production site, but when I run Hoppscotch locally, the “Documentation” section doesn’t appear in the Spotlight search, so I can’t trigger the same API calls. Just want to confirm the best way to proceed before implementing the debounce fix.

Documentation search is a cloud-only feature. You could consider adding a debounced input here, which should fix the issue.

<!-- gh-comment-id:3521806364 --> @nivedin commented on GitHub (Nov 12, 2025): > hi [@nivedin](https://github.com/nivedin) , I’m able to reproduce this bug on the production site, but when I run Hoppscotch locally, the “Documentation” section doesn’t appear in the Spotlight search, so I can’t trigger the same API calls. Just want to confirm the best way to proceed before implementing the debounce fix. Documentation search is a cloud-only feature. You could consider adding a debounced input [here](https://github.com/hoppscotch/hoppscotch/blob/2d30c9530d44809fb42e42fd0493286d281d241f/packages/hoppscotch-common/src/components/app/spotlight/index.vue#L11-L12), which should fix the issue.
Author
Owner

@soumyamakkar commented on GitHub (Nov 17, 2025):

Hi, I have raised the PR. Let me know if any changes are required.

<!-- gh-comment-id:3542588216 --> @soumyamakkar commented on GitHub (Nov 17, 2025): Hi, I have raised the PR. Let me know if any changes are required.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2143
No description provided.