From 77e7ad4c7dbf1f58fbf7785d28a31d5c12591813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 21 May 2026 10:12:51 +0200 Subject: [PATCH] fix(catalog-react): clear fetch dedup ref on failure instead of reverting to previous params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- plugins/catalog-react/src/hooks/useEntityListProvider.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 01a02da7a3..f49f5d1993 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -315,7 +315,6 @@ export const EntityListProvider = ( if (isEqual(fetchParams, lastFetchParamsRef.current)) { return; } - const prevFetchParams = lastFetchParamsRef.current; lastFetchParamsRef.current = fetchParams; const gen = ++fetchGenRef.current; @@ -329,7 +328,10 @@ export const EntityListProvider = ( } } catch (e) { if (gen === fetchGenRef.current) { - lastFetchParamsRef.current = prevFetchParams; + // Clear the ref so the same params can be retried, and so + // a response discarded due to a concurrent request (gen mismatch) + // doesn't permanently block fetching those params again. + lastFetchParamsRef.current = undefined; setError(e as Error); } } finally {