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
Traversal without unique() never terminates on cycles (OOMs test suite) #10
TraversalQuery.toArray() only consults visited when .unique() is set (src/query/TraversalQuery.ts:235). Without .unique() and without maxDepth, any cycle makes the BFS queue grow forever.
Repro:
constg=newGraphDatabase(':memory:');constx=g.createNode('T',{}),y=g.createNode('T',{});g.createEdge(x.id,'CYC',y.id);g.createEdge(y.id,'CYC',x.id);g.traverse(x.id).out('CYC').toArray();// never returns
With maxDepth(6) it returns 6 rows for 2 distinct nodes and re-includes the start node.
Impact
tests/unit/TraversalQuery.test.ts OOMs at ~4 GB (the fixture has an F→C cycle; tests at lines 288, 321, 382 call toArray() without maxDepth).
tests/integration/graph-operations.test.ts times out.
Masked by CI || true (separate issue).
Expected
Non-unique traversal keeps returning a node once per distinct path (test should work without unique() - allow duplicates), but must not revisit a node already on the current path. That terminates on every finite graph.
Benchmark report: 2026-11-02, Apple M2 Pro, Node 22, at a7f9ea7.
Activity