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
fix(db): propagate changes through nested toArray includes at depth 3+ (#1457)
* fix(db): propagate changes through nested toArray includes at depth 3+
flushIncludesState only flushed entries dirty from direct child changes
(Phase 2) or single-level buffer drain (Phase 3). When only the deepest
level changed (e.g., textDeltas in runs→texts→textDeltas), intermediate
levels had no changes, so Phase 4 never triggered recursive flushing and
deep buffer changes were permanently stranded.
Add a third pass in Phase 4 that scans child registry entries for pending
deep nested buffer changes via hasPendingIncludesChanges(). Entries with
stranded buffers are recursively flushed and their correlation keys added
to the inline re-emit set.
Also prevent toArray()/concat(toArray()) from being silently wrapped as
Value nodes inside expressions like coalesce() — throw a clear error at
query construction time instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: add changeset for nested includes fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: apply automated fixes
* fix: resolve TypeScript errors in chained collection test
Remove explicit generic parameter from createLiveQueryCollection and use
`any` casts for query/select callbacks in the chained darix pattern test,
matching the style used in other test cases.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: move repro tests into existing includes.test.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Fix nested `toArray()` includes not propagating changes at depth 3+. When a query used nested includes like `toArray(runs) → toArray(texts) → concat(toArray(textDeltas))`, changes to the deepest level (e.g., inserting a textDelta) were silently lost because `flushIncludesState` only drained one level of nested buffers. Also throw a clear error when `toArray()` or `concat(toArray())` is used inside expressions like `coalesce()`, instead of silently producing incorrect results.
0 commit comments