Skip to content

Fix search showing stale results on rapid queries (fixes #24)#27

Merged
JeremiahM37 merged 1 commit intomainfrom
fix/issue-24-search-lag
Apr 21, 2026
Merged

Fix search showing stale results on rapid queries (fixes #24)#27
JeremiahM37 merged 1 commit intomainfrom
fix/issue-24-search-lag

Conversation

@JeremiahM37
Copy link
Copy Markdown
Owner

@JeremiahM37 JeremiahM37 commented Apr 21, 2026

Previous searches were not cancelled when a new search started, so slow responses would overwrite newer results. Added request cancellation and a generation counter to discard stale responses.

Added AbortController to cancel in-flight search requests when a new
search starts. Also added a generation counter so late-arriving responses
from superseded searches are discarded. Previously, typing a new query
while the old search was still loading would show old results because
the slow response arrived last and overwrote the state.
@JeremiahM37 JeremiahM37 changed the title Fix stale search results on rapid re-search (fixes #24) Fix search showing stale results on rapid queries (fixes #24) Apr 21, 2026
@JeremiahM37 JeremiahM37 merged commit 26765d9 into main Apr 21, 2026
2 checks passed
@JeremiahM37 JeremiahM37 mentioned this pull request Apr 21, 2026
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.

1 participant