You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e832ca6
Browse filesBrowse the repository at this point in the historyBrowse files
docs(core): the 34990 note no longer says a class instance is never refused, and the null-rooted shape is declared
Changeset and docblock prose only, plus the foreign-realm predicate's
Array.isArray read moved inside its try. No behaviour change.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb
Copy file name to clipboardExpand all lines: .changeset/34990-nested-relation-filter-node.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ Metadata-protocol: none
11
11
12
12
**BREAKING** for a host that filters a `ValueDataSource` (the in-memory `provider: 'value'` source) with a comparison whose comparand is a plain object (prototype `Object.prototype` or `null`) with no `$` key, such as `['account', '!=', { owner: 'u1' }]`, under `!=`, `not_contains` or an ordering operator (`>`, `>=`, `<`, `<=`).
13
13
14
-
- FROM: `!=` and `not_contains` served every row, and an ordering operator compared each value with the text `[object Object]` and served the string values that happened to sort past it. That holds for an object whose prototype is `Object.prototype`. A `null`-prototype object has no `toString` or `valueOf`, so an ordering operator threw `TypeError: Cannot convert object to primitive value` and `find` rejected; `not_contains` threw as soon as it reached a row holding a string, and served every row when none did.
14
+
- FROM: `!=`served every other row (every row but one holding the caller's own object) and `not_contains` every row, and an ordering operator compared each value with the text `[object Object]` and served the string values that happened to sort past it. That holds for an object whose prototype is `Object.prototype`. A `null`-prototype object has no `toString` or `valueOf`, so an ordering operator threw `TypeError: Cannot convert object to primitive value` and `find` rejected; `not_contains` threw as soon as it reached a row holding a string, and served every row when none did.
15
15
- TO: the condition is refused by name. It excludes every row and logs the sentence the object form `{ account: { owner: 'u1' } }` already logs. `=` compared by reference, so it matched no row unless a row held the caller's own object (stored through `create` or `update`, which copy shallowly), and that row matched; it matches none now and gains the log line.
16
16
- The spec's comparand door already refuses an object comparand under these operators, so the rows served before were a wrong answer. Spell a relation condition only against a server-backed source, whose server joins it; a value source holds flat rows, so filter there on the row's own fields.
17
17
18
18
`convertFiltersToAST` now lowers the nested-relation form the spec declares on `FilterCondition` (`{ account: { owner: 'u1' } }`, a plain object with no `$` key beneath a field) to one equality node, `['account', '=', { owner: 'u1' }]`, which the spec's `parseFilterAST` reads back as the same nested condition. It used to refuse that shape as an unknown operator. The condition travels as written, deeper relations included; whether the field is a relationship is judged by the server, which answers `INVALID_FILTER` / 400 for such a condition under a field that stores a scalar or a structured-JSON value, and, under a relationship, for a condition key the related object does not declare, a dotted key, or a relation nested past the hop limit. A map that mixes `$` operators with plain keys is still refused.
19
19
20
-
`ValueDataSource` (the in-memory `provider: 'value'` source) does not descend into relations, and it now says so for the lowered node too: a comparison whose comparand is a plain object with no `$` key, such as `['account', '=', { owner: 'u1' }]`, excludes every row and logs the same sentence the object form `{ account: { owner: 'u1' } }` already logged, for `=`, `!=` and every other operator that reads the comparand. Before this, `=` compared the object by reference and matched no row without a word, unless a row held the caller's own object, and `!=` matched every other row. A class instance is not refused, even one with keys of its own such as a moment, luxon or decimal object: it is a value, and an ordering operator still compares it through its `valueOf` when that returns a primitive; otherwise as its text.
20
+
`ValueDataSource` (the in-memory `provider: 'value'` source) does not descend into relations, and it now says so for the lowered node too: a comparison whose comparand is a plain object with no `$` key, such as `['account', '=', { owner: 'u1' }]`, excludes every row and logs the same sentence the object form `{ account: { owner: 'u1' } }` already logged, for `=`, `!=` and every other operator that reads the comparand. Before this, `=` compared the object by reference and matched no row without a word, unless a row held the caller's own object, and `!=` matched every other row. A class instance is not refused as a relation, even one with keys of its own such as a moment, luxon or decimal object: it is a value. An ordering operator compares it through its `valueOf` when that returns a primitive, otherwise as its text; under an equality, membership or text operator it is refused, in a sentence of its own.
21
21
22
22
`resolveDatasetDrillFilter` uses it: a dataset dimension whose field is a relationship path (`account.owner`, up to three hops) drills as `{ account: { owner: VALUE } }`, nested one level per hop, instead of reading up to 200 related ids per hop and filtering on `$in` them. No related record is read, nothing is capped, and the `too-many` answer is no longer produced; `DATASET_DRILL_RELATED_ID_CAP` and the `too-many` member of `DatasetDrillResolution` stay exported, marked deprecated. The schema reads that check each hop is a single-valued relationship, the hop limit and the empty-bucket refusal are unchanged.
Copy file name to clipboardExpand all lines: .changeset/35735-filter-flag-and-comparand-edges.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Metadata-protocol: none
25
25
- FROM: compared by reference or as its text. `$eq` / `=` and `$in` answered no row unless a row held the caller's own instance (stored through `create` or `update`), and that row matched; `$ne` and `$nin` served every other row. `$contains`, `$startsWith` and `$endsWith` matched on the instance's `String()` text and served rows (a `new String('ab')`, a class with a `toString`), and `$notContains` served their complement.
26
26
- TO: refused, in both dialects, with `filter comparand on field 'age' is a Amount instance, which the in-memory matcher compares only by order…`. The spec's comparand door refuses it at these operators.
27
27
- Not moved: under `$gt` / `$gte` / `$lt` / `$lte` / `$between` it is still compared through its `valueOf` when that returns a primitive; otherwise as its text. `$icontains` keeps its own text-comparand refusal.
28
+
- Also moved: an object whose prototype is a `null`-prototype object, such as `Object.create(Object.create(null))`. FROM: `convertFiltersToAST` read it as an operator map (with no own key it was refused as an empty operator map; with `$` keys it lowered), and in comparand position the value data source compared it by reference under `$eq` / `$in`, and under an ordering operator threw `TypeError: Cannot convert object to primitive value` and `find` rejected, unless its prototype defines a `valueOf`, which it then compared through. TO: both faces refuse it as `an object of an unrecognised type`: the converter as the field's whole condition, and the value data source in comparand position under every operator.
28
29
29
30
**Not moved.** A scalar, a `Date` and a `{ $field }` reference are compared as before; `$empty` keeps its boolean-flag refusal, with the converter's sentence now built by the same helper as `$null` / `$exists`; a `null`-prototype object of this realm is still an operator map.
0 commit comments