You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useTableRowExpansion: add cycle guard to tree walks (stack overflow on cyclic data) #3971
useTableRowExpansionState walks the tree in three places — depthMap, the flattened data, and allExpandableKeys — and none of the walks guard against cycles. If getChildren ever returns an ancestor (cyclic data, or a self-referential row), the recursion never terminates → stack overflow / hung render.
// current: no ancestor trackingfunctionwalk(items: T[],depth: number){for(constitemofitems){map.set(getRowKey(item),depth);if(expandedKeys.has(getRowKey(item))){walk(getChildren(item),depth+1);// recurses forever on a cycle}}}
Fix
Adopt the ancestor-chain Set guard used in #3789's tree walks: track the ids on the current path and continue when an edge points back at an ancestor.
Activity
test(Table): pin ancestor-path semantics of the rowExpansion cycle gu…
fix(Table): guard rowExpansion tree walks against cyclic data (meta#4070