|
| 1 | +--- |
| 2 | +'@object-ui/core': patch |
| 3 | +--- |
| 4 | + |
| 5 | +`convertFiltersToAST` now refuses a bare ARRAY in comparand position — |
| 6 | +`{ tags: ['a', 'b'] }` — with a `FilterOperatorError` (`INVALID_FILTER` / 400) |
| 7 | +that names the field, prints the comparand and prescribes the spelling that |
| 8 | +works, instead of lowering it to `['tags', '=', ['a', 'b']]` (objectui#8530). |
| 9 | + |
| 10 | +That node was never answerable: the ObjectQL filter AST has no array-equality, |
| 11 | +so `@objectstack/driver-sql` refused it with `400 INVALID_FILTER` from the wire |
| 12 | +and every in-memory matcher (`@objectstack/formula`, `ValueDataSource` since |
| 13 | +objectui#8514) excluded every row. The author found out two layers away, as a |
| 14 | +failed list or an empty one. The refusal now lands at lowering time, where the |
| 15 | +field and the offending value are still in hand — the same treatment this file |
| 16 | +already gives `$regex` and `$not`, the two other shapes it cannot lower. |
| 17 | + |
| 18 | +It is deliberately NOT read as membership. `{ tags: [...] }` and |
| 19 | +`{ tags: { $in: [...] } }` are different statements and the second is already |
| 20 | +spellable; rewriting one into the other would guess at intent and silently |
| 21 | +change which rows a stored view returns — the lenient second contract |
| 22 | +objectui#8514 was resolved against on this same data shape one layer down. The |
| 23 | +error message says so, and names `$in` / `$nin` / `$between` as the spellings to |
| 24 | +use. `$in` / `$nin` / `$between` members, `$and` / `$or` groups and stored |
| 25 | +`ViewFilterRule` values (`in` / `between`) are legitimately arrays and keep |
| 26 | +lowering exactly as before. |
| 27 | + |
| 28 | +Every producer in this repository already spells a multi-value comparand |
| 29 | +`{ $in: [...] }` (measured across the `$filter` literals and record builders |
| 30 | +under `packages/*/src` and `apps/*/src`), so no shipped surface changes |
| 31 | +behaviour; only a hand-authored `{ field: [...] }` now fails at the producer |
| 32 | +instead of the consumer. No ruled contract ever answered that shape — the spec |
| 33 | +leaves an array outside `$in` / `$nin` / `$between` unruled, `driver-sql` and the |
| 34 | +in-memory matchers refuse it, and only a document store's native array-equality |
| 35 | +happened to read it — so nothing a backend was promised is taken away. |
0 commit comments