fix(kb): max depth exceeded chunks page error#3695
Conversation
PR SummaryLow Risk Overview This keeps the returned array reference stable unless Written by Cursor Bugbot for commit 59b7834. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes a "max depth exceeded" error on the chunks page by stabilizing the Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Consumer Component
participant H as useKnowledgeBaseTagDefinitions / useTagDefinitions
participant RQ as React Query (useTagDefinitionsQuery)
C->>H: call hook (every render)
H->>RQ: query.data (cached)
Note over H: useMemo([query.data])<br/>returns same [] ref<br/>if data unchanged
H-->>C: { tagDefinitions (stable ref), ... }
Note over C: No referential change →<br/>no extra re-render / useEffect trigger
Note over C,H: Before fix: (query.data ?? []) evaluated inline<br/>→ new [] every render → unstable ref<br/>→ infinite re-render / max depth exceeded
Last reviewed commit: "fix(kb): max depth e..." |
Summary
Seeing max depth error in chunks loading. This PR fixes that.
Type of Change
Testing
Tested manually
Checklist