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
I've validated the bug against the latest version of DB packages
Describe the bug
Rapidly fetching on-demand subsets (e.g. while scrolling a virtualized view that re-windows on every scroll) throws RangeError: Maximum call stack size exceeded. The stack points into query/predicate-utils.js — minusWherePredicates and isWhereSubsetInternal, which are mutually recursive and have no depth bound.
To Reproduce
Steps to reproduce the behavior:
Trigger is rapid window churn against an on-demand collection whose subset where carries an IN/= ANY clause.
A Node harness importing the real DeduplicatedLoadSubset reproduces the predicate accumulation, but the overflow needs the join-derived IN clause plus realistic async live-query timing to manifest.
Suggested fix
A depth guard on the mutually recursive walkers that bails conservatively (minus → null, isWhereSubset → false) so a too-deep case just costs a redundant re-request rather than crashing. Better still would be flattening the in→or handling so the subtraction doesn't recurse per disjunct.
Describe the bug
Rapidly fetching on-demand subsets (e.g. while scrolling a virtualized view that re-windows on every scroll) throws
RangeError: Maximum call stack size exceeded. The stack points intoquery/predicate-utils.js—minusWherePredicatesandisWhereSubsetInternal, which are mutually recursive and have no depth bound.To Reproduce
Steps to reproduce the behavior:
wherecarries anIN/= ANYclause.DeduplicatedLoadSubsetreproduces the predicate accumulation, but the overflow needs the join-derivedINclause plus realistic async live-query timing to manifest.Suggested fix
A depth guard on the mutually recursive walkers that bails conservatively (
minus→null,isWhereSubset→false) so a too-deep case just costs a redundant re-request rather than crashing. Better still would be flattening thein→orhandling so the subtraction doesn't recurse per disjunct.Desktop: