Fix stale response race condition in async search#453
Conversation
|
Any updates? Thanks @TarekRaafat |
|
Hello @iNalgiev, Apologies for my delayed reply, and thanks for your patience and for following up. Good catch! The race condition you identified is a valid issue. When async data fetches overlap, stale responses can silently overwrite newer results, and the existing debounce alone does not prevent that. Your approach is clean and minimal, which I appreciate. I have this on my radar and will be addressing it as part of the upcoming v11 release, where the async data flow is getting a broader overhaul. Your fix aligns well with the direction things are heading, and your PR will be used as the base for this specific fix. I will be publishing the v11 release plan soon, so stay connected for updates. Thanks for your valuable contribution, much appreciated! Have a nice day, cheers! :) |
When a user types quickly, multiple async requests can be in-flight simultaneously. Previously, a slower request for an earlier query for example, a user typing "sea" quickly and continuing to "search" could see results for "sea" overwrite the correct results for "search".
Changes: