Skip to content

Improve Search Request Handling to Prevent Excessive GitHub API Calls During Rapid Input #337

@ABHImaybeJEET

Description

@ABHImaybeJEET

Issue Description

Currently, repository/user search requests appear to be triggered on nearly every keystroke. During rapid typing, this can result in multiple overlapping API calls being sent to the GitHub API.

This may lead to:

  • Unnecessary API consumption
  • Increased chances of hitting GitHub rate limits
  • Flickering or inconsistent UI updates due to out-of-order responses
  • Reduced responsiveness on slower networks

The issue becomes more noticeable when typing quickly or repeatedly modifying the search query.


Expected Behavior

  • Search requests should wait briefly until the user pauses typing.
  • Previous in-flight requests should be cancelled when a new query is entered.
  • Only the latest search result should update the UI.

Proposed Solution

Implement optimized search request handling using:

  • Debouncing (e.g. 300–500ms delay before firing requests)
  • Request cancellation using AbortController or Axios cancellation
  • Optional minimum query length validation before triggering requests

Possible implementation areas:

  • Search input handlers
  • React Query fetch logic
  • Axios request utilities

This would:

  • Reduce redundant API traffic
  • Improve UI smoothness
  • Prevent stale/outdated responses from rendering
  • Improve overall scalability and API efficiency

Additional Notes

Since the application heavily relies on GitHub APIs, optimizing request behavior would improve both performance and long-term reliability, especially for users exploring multiple repositories/users rapidly.

As a Gssoc contributer , I would like if this issue is assigned to me.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions