Commit 0df4d58
fix(table): reject a v2 predicate at the legacy filter compiler
Cross-version safety net. If a client speaking the predicate grammar reaches a
server that predates it, the predicate arrives at the legacy `$`-compiler as
`{ all: [...] }`. That was skipped as "an array on a regular field", so the
filter compiled to NO WHERE CLAUSE — which on a bulk delete means every row
rather than none. `update-runner` has always had an `if (!filterClause) throw`;
`delete-runner` does not, so the background delete path (tables over 1000 rows)
was the one that could actually wipe a table.
`buildFilterClause` is the single choke point every filter path shares —
`queryRows`, `update-runner`, `delete-runner`, inline and background — so one
guard there covers all of them, and it names the mismatch instead of failing
with a generic "filter required".
Scoped to the `all`/`any` discriminators specifically: an ordinary column that
happens to hold an array stays a silent skip, so no working legacy filter
changes behaviour.
This matters for deploy ordering. The copilot and sim deploy independently, and
if the copilot ships the new grammar first it starts sending predicates to a sim
that cannot parse them. With this guard that is a loud 400 on every path instead
of a silent table wipe on one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M563cbFy2S74GvSDf2C3R1 parent 705ea6f commit 0df4d58
2 files changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
| |||
0 commit comments