Skip to content

Search throttler - #126

Merged
savage13 merged 4 commits into
masterfrom
searchThrottler
Oct 31, 2026
Merged

savage13 merged 4 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

@savage13

Copy link
Copy Markdown
Contributor Author

I think I am all set with the PR. Would be glad to merge this.

Comment thread src/components/AppMap.ts Resolved
Fix comment

Co-authored-by: Léo Lam <leo@leolam.fr>
@savage13
savage13 merged commit ed15c10 into master Oct 31, 2026
2 checks passed
@savage13
savage13 deleted the searchThrottler branch October 31, 2026 19:03
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