From cf18faa25239a9310ce52b58f6f29f699d3eb703 Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed Date: Mon, 3 Nov 2025 14:42:13 -0500 Subject: [PATCH 1/3] add page filters as a dependency to the dashboard tag fetching use effect --- static/app/views/dashboards/dashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/dashboards/dashboard.tsx b/static/app/views/dashboards/dashboard.tsx index a14cf7f9c2f332..e6fdec3ec958b0 100644 --- a/static/app/views/dashboards/dashboard.tsx +++ b/static/app/views/dashboards/dashboard.tsx @@ -179,7 +179,7 @@ function Dashboard({ GroupStore.reset(); }; // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [selection]); // Handle newWidget parsed from Add to Dashboard flows useEffect(() => { From 59e0534634adcac5ceff079aecc3e54f45e06a04 Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed Date: Mon, 3 Nov 2025 14:55:33 -0500 Subject: [PATCH 2/3] move tag fetching into separate use effect with a page filter dependency --- static/app/views/dashboards/dashboard.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/static/app/views/dashboards/dashboard.tsx b/static/app/views/dashboards/dashboard.tsx index e6fdec3ec958b0..04856b719363bd 100644 --- a/static/app/views/dashboards/dashboard.tsx +++ b/static/app/views/dashboards/dashboard.tsx @@ -155,12 +155,15 @@ function Dashboard({ ); }, [api, organization.slug, selection.projects]); - // The operations in this effect should only run on mount/unmount useEffect(() => { - window.addEventListener('resize', debouncedHandleResize); - // Always load organization tags on dashboards loadOrganizationTags(api, organization.slug, selection); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [selection]); + + // The operations in this effect should only run on mount/unmount + useEffect(() => { + window.addEventListener('resize', debouncedHandleResize); // Get member list data for issue widgets fetchMemberList(); @@ -179,7 +182,7 @@ function Dashboard({ GroupStore.reset(); }; // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selection]); + }, []); // Handle newWidget parsed from Add to Dashboard flows useEffect(() => { From 28739d07119a0d8230f4b31ab49d5dbd72d761df Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed Date: Mon, 3 Nov 2025 15:18:23 -0500 Subject: [PATCH 3/3] add all expected dependencies to new isolated tag fetching use effect --- static/app/views/dashboards/dashboard.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/app/views/dashboards/dashboard.tsx b/static/app/views/dashboards/dashboard.tsx index 04856b719363bd..0ab1f1ca7553a1 100644 --- a/static/app/views/dashboards/dashboard.tsx +++ b/static/app/views/dashboards/dashboard.tsx @@ -158,8 +158,7 @@ function Dashboard({ useEffect(() => { // Always load organization tags on dashboards loadOrganizationTags(api, organization.slug, selection); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selection]); + }, [api, organization.slug, selection]); // The operations in this effect should only run on mount/unmount useEffect(() => {