Skip to content

Commit 611daa4

Browse files
committed
chore(changeset): service-analytics $empty arms are minor, Clause-② yes (widening)
Two new optional published members (sourceFieldMeta's multiple, compileScopedFilterToSql's declaredValueShape) widen the package's public surface; names the read-scope residual of a host that answers type without multiple. Claude-Session: https://claude.ai/code/session_017B6YKCGu8CTY2KBWgwaHAs Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6a07f8c commit 611daa4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
'@objectstack/service-analytics': patch
2+
'@objectstack/service-analytics': minor
33
---
44

55
fix(service-analytics): both analytics filter faces answer `$empty` by the field's declared type (#20445)
66

7-
Clause-②: no
7+
Clause-②: yes (widening)
88

99
`$empty: true | false` is declared by `@objectstack/spec` (`FieldOperatorsSchema`) with a per-type meaning: a text-like field is empty when it is null or `''`, a multi-value field (multiselect, checkboxes, tags, or a select / radio / lookup / user / file / image with `multiple: true`) when it is null or `[]`, and every other type only when it is null. `$empty: false` is the exact complement. Both of this package's filter faces now answer it by that table, through the spec's one expansion (`expandEmptyOperator`), instead of refusing it:
1010

@@ -15,6 +15,6 @@ A multi-value field's empty list is tested with a JSON function per SQL dialect
1515

1616
**Refused, never guessed** — `INVALID_FILTER` / 400 on the `where` face, `READ_SCOPE_COMPILE_FAILED` / 500 on a read scope — when the host cannot name the field's declared type (no `sourceFieldMeta` wired, or no such field), when a multi-value field's datasource dialect is unknown, and when the flag is not a boolean (`$empty: 'true'` is refused like a non-boolean `$null`).
1717

18-
Host API: `AnalyticsServiceConfig.sourceFieldMeta` may now answer `multiple` beside `type`; `AnalyticsServicePlugin` relays it from the field definition. A host that omits it has every multi-capable field read as single-valued. `compileScopedFilterToSql` takes an optional `declaredValueShape` option.
18+
Host API (two new optional members, hence `minor`): `AnalyticsServiceConfig.sourceFieldMeta` may now answer `multiple` beside `type`, and `AnalyticsServicePlugin` relays it from the field definition; `compileScopedFilterToSql` takes an optional `declaredValueShape` option. A host whose `sourceFieldMeta` answers `type` but not `multiple` has every multi-capable field it declared `multiple: true` (select / radio / lookup / user / file / image) read as single-valued, which is the null-only row. On such a field a read scope's `$empty: false` then admits rows holding `[]`, and `$empty: true` misses them. Relay the field's `multiple` from its definition to get the list row.
1919

2020
`$empty` stays staged: it is not in `FILTER_OPERATORS`, and the view operators `is_empty` / `is_not_empty` still lower to `$null`.

0 commit comments

Comments
 (0)