Skip to content

Search throttler - #126

Open
savage13 wants to merge 3 commits into
masterfrom
searchThrottler
Open

savage13 wants to merge 3 commits into
masterfrom
searchThrottler

Conversation

@savage13

@savage13 savage13 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

When searching for objects, the debounce() function can call multiple instances of search() and these collide if the network activity persists for too long.

  • Add a searchID, increment on each searchOnInput()
  • Query results are now stored in a local variable and only updated if the this.searchID matches functions local searchID
  • All searches are run through searchOnInput() which sets the ID properly before calling the debounced search()

Example: Sometimes searching for apple resulted an incorrect list of results with the first search on a returning after the final search for apple

This is a minor, but very confusing, annoyance on one of the main functions of the site. If this results in more issues we can discard this.


This change is Reviewable

@savage13
savage13 requested a review from leoetlino October 25, 2026 15:20
@leoetlino

Copy link
Copy Markdown
Member

can we just compare the search query instead of comparing IDs?

@savage13

Copy link
Copy Markdown
Contributor Author

Sounds good to me, as this.searchQuery already exists

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants