Skip to content

Performance: Add debouncing to GitHub API search inputs to prevent redundant requests #511

@Rajlakshmi-ai

Description

@Rajlakshmi-ai

Bug Description

Currently, the application triggers a new API request to the GitHub server on every keystroke when a user types in search or username input fields. This behavior causes unnecessary network traffic and contributes significantly to hitting GitHub's API rate limits prematurely. Implementing a "debounce" mechanism would ensure that the API request is only fired after the user has finished typing, drastically reducing the number of redundant calls.

Steps to Reproduce

  • Navigate to any search page or user input field in the application.
  • Open the browser's "Network" tab in Developer Tools.
  • Type a username (e.g., "octocat") slowly in the input field.
  • Observe the network logs.
  • Notice that an API request is triggered for every single character entered (e.g., 'o', 'oc', 'oct', 'octo', etc.).

Expected Behavior

The API request should only trigger after a short delay (e.g., 300–500ms) once the user has stopped typing. This ensures that only the final intended search string is sent to the GitHub API, saving resources and preserving the application's ability to remain within rate limits.

Environment

OS: Windows 11
Browser: Google Chrome 131.0.6778.86
Node.js Version: v20.17.0
Package Manager: npm 10.8.2

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions