TanStack

Content temporarily unavailable

PR #1302: Vue publication review

  • Raw source: PR #1302, head de5f28d6fe9ee6f89dcf81a9d39fab90d51c4e99. Its body contains eight proposed changes and detailed claims; GitHub returned no human issue or inline comments. The changeset bot comment is recorded below.
  • Baseline reviewed: ae2eb3fbf3a314a7f043f0d963fd336d8c1f1ec8 (origin/main on 2026-09-29).
  • Repaired executable tree: 7a67d6a2 on codex/pr-1302-vue-publication.
  • Executable owner: useLiveQuery-publication-oracle.test.ts. The shared conformance suite checks after Vue settles; this owner checks synchronous watcher observations during one source transaction.

Contract, evidence, and decision

One source sync transaction must not expose an intermediate empty Vue data array when the source Collection has already published nonempty final rows. A synchronous watch(..., { flush: 'sync' }) is a public Vue observation. The oracle copies source rows into a plain array and compares each hook callback with the old or final public snapshot at that callback. It requires one callback containing the final rows. Its bounded histories cross insert, update, and nonterminal delete with a supplied Collection and an identity live query. Empty final results, multi-change transactions, query recompilation, and other framework schedulers remain outside this owner.

The six oracle cells all failed on baseline main. Every cell recorded [] while the source already contained the final nonempty rows. The checker rejects that forbidden value before it checks the callback count. Baseline emits two callbacks, with [] then the final rows. The same six passed after replacing internalData.length = 0; internalData.push(...rows) with one ref.value = Array.from(rows) assignment. The baseline implementation is the hostile wrong design: it reached the intended watcher checkpoint and failed by assertion, not by timeout or setup failure. The repaired cells each observed exactly one final data callback.

A separate focused RED found that a user query throwing Error('__DISABLED_QUERY__') was misclassified as disabled. Replacing the message match with a unique Symbol sentinel made that test GREEN. Null and undefined disabled queries still pass. The change also removes stack allocation for ordinary disable, while retaining a caught throw. It does not claim to fix debugger behavior for caught exceptions.

The array fix uses Vue ref, rather than the PR's proposed shallowRef. A temporary compatibility probe found that baseline reactive and repaired ref both expose deep reactive arrays, rows, and nested values; an in-place nested edit triggered a synchronous watcher in both. This behavior is not asserted as a supported Collection mutation path, but preserving it avoids a separate observable change. The old array spread is gone; the new Array.from assignment has no function-argument limit. Production diff at 7a67d6a2: 9 additions, 19 deletions, net −10 lines. Test and coverage text weight is separate.

A baseline diagnostic also established that markReady() changed the Vue hook status to ready before returning and that stopping a standalone effectScope prevented a later source insert from changing hook data. The shared Vue no-updates-after-unmount conformance scenario reaches the same disposal path. These results do not prove every delayed callback schedule.

Lossless PR claim ledger

IDOriginal claim or suggestionVerdict and dispositionDurable destination
V01Broad Vue primitive refactor, no public API breakdesign-decision: two narrow defects confirmed; full refactor compatibility unprovedPR #1302
V02Existing 30 tests, 18 new tests, shared utils, ~83→87% coveragestale: historical PR counts; current suite differsPR #1302 test plan
V03Deep Map proxying has O(N×M) cost and no utilitydeferred: proxy wrapping is real; claimed cost unmeasuredPR #1302 performance proposal
V04Array clear+push exposes empty state; use shallowReffixed-now: six RED→GREEN cells; used deep ref to preserve behaviorVue publication oracle
V05Sentinel throw/catch has stack, debugger, and string-match costs; use builder probefixed-now for collision and allocation via unique Symbol; debugger concern remains V16Focused Vue regression
V06getCurrentInstance/onUnmounted misses standalone scope cleanup and leaksrefuted on current main: scope stop disposes watchEffect observerVue conformance disposal scenario
V07Default GC retains ephemeral hooks; gcTime:1 is preferabledesign-decision: no leak witness or approved lifetime policyPR #1302
V08Shared duck typing risks false positives; Vue should use instanceofdesign-decision: no false-positive witness; a Vue-only identity rule diverges from shared helperpackages/db/src/live-query-adapter.ts, PR #1302
V09nextTick leaves one-tick ready/loading mismatchalready-fixed: current observer path updates status synchronously in diagnosticVue readiness conformance
V10Add isEnabled computed fielddeferred: additive convenience API, not reproduced defectPR #1302 API proposal
V11Keep computed wrappers for API stabilityalready-fixed: preservedVue public types
V12Keep manual initialization plus initial-state subscription as safety netalready-fixed as preservation claim; rationale not independently provedVue startup conformance, PR #1302
V13Test plan repeats counts and coverage claimduplicate of V02PR #1302
V14Shallow Map tracks operations without deep-proxying valuesduplicate of V03; behavior true, benefit unmeasuredPR #1302
V15Array reference assignment gives one notification and avoids deep proxiesduplicate of V04; one callback verified; deep proxy removal intentionally omittedVue publication oracle
V16Caught sentinel causes debugger stops and middleware fragilitydeferred: no wrapped-error path or measured debugger impact; Symbol still throwsPR #1302
V17Standalone scopes, SSR, and utilities need onScopeDisposeduplicate of V06; scope disposal already works in tested pathVue conformance
V18Config gcTime should override default; precreated collections preserve theirsduplicate of V07PR #1302
V19Cross-realm instanceof caveat can be revisitedduplicate of V08; cross-copy interoperability is unsupported by current AGENTS.mdShared helper, PR #1302
V20Synchronous status avoids skeleton frame; stale callback guard neededdeferred: sync part already fixed; stale callback schedule not suppliedPR #1302
V21isEnabled completes status predicatesduplicate of V10PR #1302
V22Force startSync:true after config spreadalready-fixed on current mainExisting Vue config tests
V23Patch changeset existsalready-fixed in PR head; bot metadata, not a product findingPR #1302 changeset

New finding S01 (outside the 23 raw claims): An application error with the internal disabled-marker text was swallowed. Baseline focused regression failed because useLiveQuery did not throw; the same regression passed with the unique Symbol sentinel. Its durable owner is packages/vue-db/tests/useLiveQuery.test.ts.

Oracle-guide audit

RequirementOutcome for the Vue publication oracle
ORC-001The law is the hook's coherent public data publication at a synchronous Vue watcher cut, motivated by the PR's explicit behavioral report. Six finite histories bound the claim; the omitted histories are named above and in the coverage map.
ORC-002Expected rows come from copied source Collection values, not the hook's array update, Vue ref, or observer classifier.
ORC-003The file names contract, model, grammar, production driver, and refinement check separately.
ORC-004Not triggered: fixed bounded matrix, no generated-history coverage claim.
ORC-005The driver invokes the real useLiveQuery overloads and source sync transaction; a synchronous public Vue watcher records every data callback and confirms source final state at each callback.
ORC-006Baseline clear+push is the hostile mutant. All six cells failed at the synchronous watcher content assertion on []; repaired cells passed.
ORC-007Not triggered: no important generated property or random campaign.
ORC-008Not triggered: the independent model is stateless copied rows.
ORC-009source Collection, sync transaction, and public snapshot follow the glossary; plain copied rows are a test-only projection.
ORC-010The driver captures the primary assertion failure, attempts all cleanup steps, and aggregates separate cleanup errors without erasing the primary cause. No cleanup fault was injected.
ORC-011No plausible shared semantic fault between copied source values and hook array notification was identified. The alternate supplied-Collection and identity-query paths exercise different hook inputs, but are not called independent semantic formulations.
ORC-012This versioned record ties the executable evidence to 7a67d6a2 and states contract × history × path × observation limits. The six-cell fix does not claim closure for untested Vue histories.

Verification and reviewer assessment

  • Baseline ae2eb3fb: publication oracle 6/6 RED; sentinel regression RED; same-turn readiness and scope-disposal diagnostic GREEN.
  • Candidate 7a67d6a2: publication oracle 6/6 GREEN with focused test typecheck; sentinel and existing disabled tests GREEN; all Vue runtime tests 106/106 GREEN; production TypeScript check and formatting GREEN.
  • Package-wide Vitest typecheck reports 149 existing cross-package rootDir errors from shared conformance imports. The runtime assertions pass; the focused oracle typecheck and production TypeScript check pass.

The PR author identified a real, high-signal Vue publication defect and offered a repair with the right atomic shape. Their other proposals mix API design, unmeasured performance claims, and claims already addressed on current main. A narrow ref assignment preserves more behavior than the proposed shallowRef. As a reviewer sample, this artifact alone is insufficient to recommend hiring: the core observation is strong, but prioritization and evidence for the broader refactor are weak.

Loss audit: 23 raw items = 2 fixed-now + 6 already-fixed/stale + 1 refuted + 4 deferred + 3 design-decision + 7 duplicates. S01 is one additional, fixed-now finding. No raw item or bot comment was dropped. The deferred items have destinations in #1302; V20 specifically needs a held stale-callback schedule before any guard is justified.