Patch Changes
-
Fix
.select()collapsing discriminated-union fields to the intersection of common keys (#1511).Ref<T>now distributes overTsokeyof (A | B | C)no longer reduces the union to its common keys, andExtractRef<T>now distinguishes a real brandedRef(where the underlying user typeUcan be returned directly) from a spread-produced inline object (which still needs to be projected throughResultTypeFromSelect). This preserves discriminated unions both when the field is selected at the top level and when the field is nested inside another selected object. The real-Refdetection uses a strict structural equivalence against the canonicalRef<U>shape, so spread-derived objects that keep the same keys but change a field's type (e.g.{ ...u, code: u.slug }) or drop an optional key (e.g.const { nickname, ...rest } = u) are projected throughResultTypeFromSelectinstead of being collapsed back toU. (#1597) -
fix(db): keep deeply nested includes in sync when sibling groups share nested correlation keys (#1607)
Deeply nested includes could drop or stop updating nested rows when sibling parent groups shared the same nested correlation key, especially when one sibling group was inserted after the initial load. Shared nested pipeline buffers were being drained through route state that was scoped too narrowly, so one branch could consume a buffered update before other branches that referenced the same nested row received it.
Nested route state is now shared at the same scope as the nested buffer and routes updates to every concrete destination branch before clearing the buffer. Snapshot replay still seeds late-arriving sibling groups with already-materialized rows, and recursive pending-change detection ensures deeper routed updates are flushed back up through the result tree.