Commit edff010
* fix(filter): refuse a where on a virtual formula field at both doors (#8296)
The FILTER axis was the last of the three query axes with no
unmaterializable verdict: a `where` on a `formula` field cleared
`assertFilterFieldsExist` because the field IS known, reached a driver
that materialises no column for it, and answered 200 with zero rows in
BOTH directions — while SORT (#6994/#7095) and SEARCH (#6674) refuse the
same field by name.
Ingress: `assertFilterFieldsExist` grows a second verdict, judged by the
same `@objectstack/spec/data` predicate the search axis uses
(`isVirtualSearchField`), so gate and drivers cannot disagree about which
types have a column. `summary`/`autonumber` keep filtering — both have
real stored columns.
Engine: `assertFilterIsMaterializable` closes the door the REST ingress
cannot reach — a saved report forwards `query.filter` straight into
`engine.find` — at `lowerWhereFilterArray`, the one seam every
caller-supplied `where` passes through (find/findOne/count/aggregate/
update/delete).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WMpuAfA2KSdDjGF6tm1bH
* chore: changeset for the filter-axis unmaterializable verdict (#8296)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WMpuAfA2KSdDjGF6tm1bH
* test(app-todo): the derive-route reverse test now pins the refusal envelope (#8296)
`derived-flag-removal.test.ts` registers a test-local formula-shaped object
(`derived_task`, invented by that file) to record why #7226 removed two inert
flags rather than deriving them, and it pinned the exact behaviour #8296
abolishes: filtering a formula answering 0 rows with no error. Its three
filtering assertions now assert the rejection envelope (status 400,
INVALID_FIELD, field, object) instead of an empty array, and the `it` title no
longer claims "0 rows, no error".
#7226's decision is unchanged and its reasoning is stronger: a formula field
still materialises no column and still cannot carry a predicate, so the eight
app filters that named those flags still could not have worked. Only the
failure mode changed, from an invisible zero to a named 400 -- which is the
exception this very docblock had named as the safe design. Both docblocks are
rewritten to state that.
The read/projection half (a formula COMPUTES both flags correctly) and the
stored-column CONTROL assertions are untouched; nothing under
examples/app-todo/src/ or objectstack.config.ts is touched, and that app
declares no formula field at all.
The changeset's blast-radius sentence is corrected in the same commit: the
original sweep covered app source and missed test files, which is where current
behaviour is pinned and therefore where a behaviour change lands first. No app
metadata filters a formula field -- that half held.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WMpuAfA2KSdDjGF6tm1bH
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0e04899 commit edff010
6 files changed
Lines changed: 654 additions & 41 deletions
File tree
- .changeset
- examples/app-todo/test
- packages
- metadata-protocol/src
- objectql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
| |||
229 | 241 | | |
230 | 242 | | |
231 | 243 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
236 | 261 | | |
237 | 262 | | |
238 | 263 | | |
| |||
276 | 301 | | |
277 | 302 | | |
278 | 303 | | |
279 | | - | |
| 304 | + | |
280 | 305 | | |
281 | 306 | | |
282 | 307 | | |
283 | 308 | | |
284 | 309 | | |
285 | | - | |
286 | | - | |
287 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
288 | 321 | | |
289 | 322 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
295 | 332 | | |
296 | 333 | | |
297 | | - | |
298 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
299 | 337 | | |
300 | 338 | | |
301 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5866 | 5866 | | |
5867 | 5867 | | |
5868 | 5868 | | |
5869 | | - | |
5870 | | - | |
5871 | | - | |
| 5869 | + | |
| 5870 | + | |
| 5871 | + | |
| 5872 | + | |
| 5873 | + | |
| 5874 | + | |
| 5875 | + | |
| 5876 | + | |
| 5877 | + | |
| 5878 | + | |
| 5879 | + | |
| 5880 | + | |
| 5881 | + | |
| 5882 | + | |
| 5883 | + | |
| 5884 | + | |
| 5885 | + | |
| 5886 | + | |
| 5887 | + | |
| 5888 | + | |
| 5889 | + | |
| 5890 | + | |
| 5891 | + | |
5872 | 5892 | | |
5873 | 5893 | | |
5874 | 5894 | | |
| |||
5878 | 5898 | | |
5879 | 5899 | | |
5880 | 5900 | | |
5881 | | - | |
5882 | | - | |
| 5901 | + | |
| 5902 | + | |
| 5903 | + | |
| 5904 | + | |
| 5905 | + | |
| 5906 | + | |
| 5907 | + | |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
| 5911 | + | |
| 5912 | + | |
| 5913 | + | |
| 5914 | + | |
| 5915 | + | |
| 5916 | + | |
| 5917 | + | |
| 5918 | + | |
| 5919 | + | |
| 5920 | + | |
| 5921 | + | |
| 5922 | + | |
| 5923 | + | |
| 5924 | + | |
| 5925 | + | |
| 5926 | + | |
| 5927 | + | |
| 5928 | + | |
| 5929 | + | |
| 5930 | + | |
| 5931 | + | |
| 5932 | + | |
| 5933 | + | |
| 5934 | + | |
| 5935 | + | |
| 5936 | + | |
| 5937 | + | |
| 5938 | + | |
| 5939 | + | |
| 5940 | + | |
| 5941 | + | |
| 5942 | + | |
| 5943 | + | |
| 5944 | + | |
| 5945 | + | |
| 5946 | + | |
| 5947 | + | |
| 5948 | + | |
| 5949 | + | |
| 5950 | + | |
| 5951 | + | |
| 5952 | + | |
| 5953 | + | |
| 5954 | + | |
| 5955 | + | |
| 5956 | + | |
| 5957 | + | |
| 5958 | + | |
| 5959 | + | |
| 5960 | + | |
| 5961 | + | |
| 5962 | + | |
| 5963 | + | |
| 5964 | + | |
| 5965 | + | |
5883 | 5966 | | |
5884 | | - | |
5885 | | - | |
5886 | | - | |
5887 | | - | |
5888 | | - | |
5889 | | - | |
| 5967 | + | |
| 5968 | + | |
| 5969 | + | |
| 5970 | + | |
| 5971 | + | |
| 5972 | + | |
| 5973 | + | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | + | |
| 5979 | + | |
| 5980 | + | |
| 5981 | + | |
5890 | 5982 | | |
5891 | 5983 | | |
5892 | 5984 | | |
5893 | | - | |
5894 | | - | |
| 5985 | + | |
| 5986 | + | |
5895 | 5987 | | |
5896 | 5988 | | |
5897 | 5989 | | |
| |||
0 commit comments