From b08760ef856cf12b36ce560a1f8c56e240a1dd17 Mon Sep 17 00:00:00 2001 From: Vorflux AI Date: Sun, 29 Mar 2026 00:36:07 +0000 Subject: [PATCH] fix: add limitedDocuments dependency to activeVersionChain useMemo Prevents stale version chain data when documents change but the selected node stays the same. The chainIndex ref is rebuilt in a useEffect when limitedDocuments changes, but without this dependency the useMemo would return cached (stale) chain data. --- packages/memory-graph/src/components/memory-graph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/memory-graph/src/components/memory-graph.tsx b/packages/memory-graph/src/components/memory-graph.tsx index cf35e234..bdae2e8a 100644 --- a/packages/memory-graph/src/components/memory-graph.tsx +++ b/packages/memory-graph/src/components/memory-graph.tsx @@ -497,7 +497,7 @@ export function MemoryGraph({ const activeVersionChain = useMemo(() => { if (!activeNodeData || activeNodeData.type !== "memory") return null return chainIndex.current.getChain(activeNodeData.id) - }, [activeNodeData]) + }, [activeNodeData, limitedDocuments]) const isLoading = externalIsLoading