Skip to content

fix: use switchMap instead of flatMap for plugin search to prevent st…#11089

Open
varunsub wants to merge 1 commit intoEugeny:masterfrom
varunsub:varun/fix-plugin-search
Open

fix: use switchMap instead of flatMap for plugin search to prevent st…#11089
varunsub wants to merge 1 commit intoEugeny:masterfrom
varunsub:varun/fix-plugin-search

Conversation

@varunsub
Copy link
Copy Markdown

flatMap (mergeMap) does not cancel previous in-flight HTTP requests when a new search query arrives, causing race conditions where slower responses for old queries overwrite results for the current query.

switchMap cancels the previous inner observable on each new emission, ensuring only the latest search results are displayed.

…ale results

flatMap (mergeMap) does not cancel previous in-flight HTTP requests when
a new search query arrives, causing race conditions where slower responses
for old queries overwrite results for the current query.

switchMap cancels the previous inner observable on each new emission,
ensuring only the latest search results are displayed.
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