From 777c7ae805e32743a8a89a07c6f36d0344f60e97 Mon Sep 17 00:00:00 2001 From: Colin Rooney <102275700+12mv2@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:36:28 -0600 Subject: [PATCH] fix(web): guard parent-issues search against out-of-order responses The search effect writes the response straight into state with no cleanup. Since debouncedSearchTerm is reactive, a slower earlier request can resolve after a later one and call setIssues last, leaving the list showing results for a query the user has already moved past until the next keystroke. --- .../components/issues/parent-issues-list-modal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/web/core/components/issues/parent-issues-list-modal.tsx b/apps/web/core/components/issues/parent-issues-list-modal.tsx index 19ec49a6ef7..0f8bc782a4f 100644 --- a/apps/web/core/components/issues/parent-issues-list-modal.tsx +++ b/apps/web/core/components/issues/parent-issues-list-modal.tsx @@ -71,6 +71,8 @@ export function ParentIssuesListModal({ useEffect(() => { if (!isOpen || !workspaceSlug || !projectId) return; + let ignore = false; + setIsSearching(true); setIsLoading(true); @@ -82,11 +84,18 @@ export function ParentIssuesListModal({ workspace_search: false, epic: searchEpic ? true : undefined, }) - .then((res) => setIssues(res)) + .then((res) => { + if (!ignore) setIssues(res); + }) .finally(() => { + if (ignore) return; setIsSearching(false); setIsLoading(false); }); + + return () => { + ignore = true; + }; }, [debouncedSearchTerm, isOpen, issueId, projectId, workspaceSlug]); return (