Skip to content

Debounce search input to prevent excessive API calls #39

@Drishtipixiee

Description

@Drishtipixiee

Typing in the search box fires API calls for every keystroke (no debounce), causing excessive requests and potential rate-limit issues.

Steps to reproduce:
Open search page.
Type quickly into search input.
Observe multiple rapid requests to the search endpoint.

Actual: one API call per keystroke.
Expected: search should debounce input (e.g., 300–500ms) and only call API when user pauses.

Root cause: missing debounce logic on search input.

Proposed fix:
Add debounce (300–500ms) on input before calling API (Lodash debounce or custom).
Optionally cache results for repeated terms and add a loading indicator.
Add unit tests simulating rapid typing.

If valid, please assign to @Drishtipixiee — under wocs label. I’ll open a PR implementing debounce and tests.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions