Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort pending searches when the query is changed #541

Open
js0mmer opened this issue Dec 11, 2024 · 0 comments
Open

Abort pending searches when the query is changed #541

js0mmer opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
bug Something isn't working frontend Front End tasks

Comments

@js0mmer
Copy link
Member

js0mmer commented Dec 11, 2024

Use AbortController to abort a pending fuzzy search. Otherwise, a scenario such as the following can occur:

  1. User types in a query
  2. User adjusts the query (a common scenario could be correcting a typo), but not before the search procedure call is sent
  3. A new procedure call is sent for the updated query
  4. The new procedure call receives a response first and the results update
  5. The old procedure call receives a response second and then the results update again to incorrect ones

I believe this scenario can happen quite frequently if the second call hits the AnteaterAPI cache and the first one misses.

https://trpc.io/docs/client/vanilla/aborting-procedure-calls

There are probably other places in our codebase where we may want to abort procedure calls.

example:

Recording.2024-12-11.145521.mp4
@js0mmer js0mmer added the frontend Front End tasks label Dec 11, 2024
@js0mmer js0mmer added the bug Something isn't working label Dec 11, 2024
@timobraz timobraz self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Front End tasks
Projects
Status: Backlog
Development

No branches or pull requests

2 participants