|
| 1 | +--- |
| 2 | +'@objectstack/service-analytics': patch |
| 3 | +'@objectstack/driver-sql': patch |
| 4 | +'@objectstack/driver-turso': patch |
| 5 | +--- |
| 6 | + |
| 7 | +fix(analytics)!: the native dataset face and the draft preview refuse `=` / `$in` / `$ne` on a single-value `image` or `file` column the driver stores as JSON, as the data door does |
| 8 | + |
| 9 | +Clause-②: yes (narrowing) — widened: `SqlDriver.jsonColumnFieldClass` (`@objectstack/driver-sql`) is now public, and so on every class that extends it (`TursoDriver`, `SqliteWasmDriver`), and the exported `AnalyticsServiceConfig` (`@objectstack/service-analytics` root) gains the optional key `jsonColumnFieldClass`; narrowed: the native dataset face and the draft preview newly answer `400 INVALID_FILTER` for a scalar comparison on a single-value media column the driver stores as JSON, which they answered `200` with a wrong count before |
| 10 | +Metadata-protocol: none |
| 11 | +Skills-docs: none — no published skill documents the dataset door's filter vocabulary per storage class; the refusal text itself carries the prescription (the media-column move), and the operator contract `skills/` describes (`$contains` for membership on a JSON column) is unchanged |
| 12 | + |
| 13 | +<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no stored row, registry key or authored value changes. What moves is the answer the native dataset face and the draft preview give a scalar comparison on a single-value media column, so no stored row, registry key or authored value changes and there is nothing for a migration to rewrite. --> |
| 14 | + |
| 15 | +**BREAKING** for a caller of the dataset query door whose filter compares a single-value `file` / `image` / `avatar` / `video` / `audio` field with `=` (explicit or implicit), `$in`, `$ne`, `$nin`, an ordering comparison, `$between` or the non-membership text family, on a deployment still inside the ADR-0104 dual-encoding window (its media columns not yet moved, which is every deployment that has not run the move). |
| 16 | + |
| 17 | +- FROM: the native dataset face compiled the comparison against the stored JSON string (`"file_1"`) and answered `200` with the wrong count — `{ pic: 'file_1' }` and `{ pic: { $in: ['file_1'] } }` counted `0`, `{ pic: { $ne: 'file_1' } }` counted every row — and the draft preview answered `200` with its own counts, matching the bare id a drafted row holds. `POST /api/v1/data/:object/query` and this door's ObjectQL strategy already refused the same filter `400` `INVALID_FILTER`. |
| 18 | +- TO: all four faces refuse it `400` `INVALID_FILTER`, in `@objectstack/core`'s one refusal text for this column class — the media-column move, not the `$contains` membership repair, which finds no member in a single JSON string. |
| 19 | + |
| 20 | +**Widened, alongside.** `SqlDriver.jsonColumnFieldClass(table, field)` is now a public, read-only member: it answers `'single-value-media'`, `'multi-value-or-json'` or `undefined` for a column on this deployment, the same answer the data door's refusal reads. A subclass that redeclares it as `protected` must widen it to `public`. `AnalyticsServiceConfig.jsonColumnFieldClass` is the optional hook the analytics host reads it through; `AnalyticsServicePlugin` wires it from the driver that stores the object, and a host that wires nothing keeps its earlier behaviour. `TursoDriver` answers it on the remote face from the same registry its remote transport already reads. |
| 21 | + |
| 22 | +**Not moved.** `$contains` / `$notContains` and the null predicates (`$null`, `$exists`, `$empty`) on such a column, every operator on a scalar column, the multi-value and structured-JSON class (unchanged since it was refused on these faces), and a deployment whose media columns have moved — the column is not JSON there, and the comparison is answered. |
| 23 | + |
| 24 | +The fix for a caller: filter on the record the attachment belongs to, ask presence with `$null` / `$empty`, or finish the deployment's media-column move (the column step of `objectstack migrate files-to-references --apply`, which the refusal text prescribes) so the column is comparable. |
0 commit comments