test(server): characterize SQL/JS predicate parity — ne crashes handleSub, like diverges#6
Open
grrowl wants to merge 2 commits into
Open
test(server): characterize SQL/JS predicate parity — ne crashes handleSub, like diverges#6grrowl wants to merge 2 commits into
grrowl wants to merge 2 commits into
Conversation
Two divergences confirmed (plan 003):
1. `ne` — accepted by sql-compiler.ts COMPARATORS but rejected by
@tanstack/db compileSingleRowExpression ("Unknown function: ne").
The subscription hangs: the client never receives snap-end.
Operator floor is inconsistent across the two evaluators.
2. `like` — SQLite LIKE is case-insensitive for ASCII (default);
@tanstack/db is case-sensitive. "HELLO" matches LIKE "hello%"
in the snapshot path but not in the delta path. Clients diverge
by connection timing.
4 cases verified passing (eq, gt, not(eq), in) — NULL three-valued
logic is mirrored by toBooleanPredicate for those operators.
Failing cases are marked it.fails() so the suite stays green while
the divergences are visible. Fix needs a maintainer decision + ADR
(see plan 003 Maintenance notes for options).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tive cases The helper was defined but only called from case 1 (ne), which is unreachable because snapshotMembers times out first on the ne crash. Wire it into cases gt, not(eq), and in — each using a third uniquely-named room (pp-gt-delta-explicit, pp-not-delta-explicit, pp-in-delta-explicit) — and assert the omit-spelling and explicit-null-spelling delta members agree, naming the spelling mismatch in the failure message (plan 003 step 2). Also soften the always-emit comment in deltaMembers from "the assertion below surfaces it" (incorrect — a missing d frame is currently silent) to "currently silent here; see STOP condition in plan 003". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executes plan 003 from the advisor audit. Characterization tests only — and they found real divergence. The failing cases are marked
it.fails(suite stays green; they'll loudly flip the moment a fix lands).Confirmed divergences
necrashes the DO'shandleSub; the client hangs forever.sql-compiler.tsacceptsnein its operator floor, but @tanstack/db'scompileSingleRowExpressionthrowsQueryCompilationError: Unknown function: ne— fromcompilePredicateviasubs.add, outside theUnsupportedPredicateErrorcatch. Noresetis sent, nosnap-endarrives.likemembership depends on connection timing. SQLiteLIKEis ASCII-case-insensitive; @tanstack/db'slikeevaluator is case-sensitive."HELLO"is in the snapshot underlike "hello%"but excluded from deltas.eq,gt,not(eq),inwere verified to agree on NULL semantics across both paths (including the null-vs-omitted spelling variants).Next (maintainer decision + ADR — deliberately not in this PR)
compilePredicatefailures inhandleSub(sendreset).🤖 Generated with Claude Code