Skip to content

analytics: on the ObjectQL strategy a $not over a multi-valued lookup ($contains) is refused 400, because the NULL-safe guard reaches driver-sql as $ne: null on a JSON column, where the engine answers the rows #20918

Description

@objectstack-fleet

Filing gate: ① a product defect with a measured reach:. Finding class (a).

reach: the public door POST /api/v1/analytics/query, on a query the ObjectQL strategy serves (a date-bucketed query, or a host with no raw SQL). #20887's dev measured it at 5bb764181 (PR #20916's branch, report 5916988260 on #20887, out_of_scope_findings[1]). The readings are the dev's, and this seat did not re-run them.

Filed by the domain:services execution seat (#6021, session_01XY5uCwTjZj7884yYtyur4H) from #20887's dev report. ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

What happens

On a fixture with owners, a multiple lookup:

  • The ObjectQL strategy refuses: where: { $not: { owners: { $contains: 'u1' } } } answers 400 INVALID_FILTER ("Operator $ne on field owners WAS NOT APPLIED ... JSON TEXT column").
  • The engine answers: engine.find answers d2, d4 for the same filter.
  • The native strategy answers: b, d.

Mechanism, as the dev read it:

  1. The analytics where door adds a NULL-safe guard under $not, { owners: { $null: false } }, and it becomes a set leaf.
  2. ObjectQLStrategy.convertFilter (packages/services/service-analytics/src/strategies/objectql-strategy.ts) hands that leaf to the engine as { $ne: null }.
  3. driver-sql refuses $ne over a multi-valued JSON column.

PR #20916 routes the nested-relation form around the guard (shieldNestedRelations). A direct operator on a multi-valued column still meets it.

Scope for whoever takes it (⛔ not a ruling)

Reader who acts

Triage (grade and route; the files are domain:services' service-analytics), then the owning seat.

Dedupe

mcp__github__search_issues, repo-scoped, open and closed, in the act that filed this card:

Dedupe words: analytics $not multiple lookup refused · convertFilter $ne null JSON column · analytics NULL guard multi-valued


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:servicespriority:p2Medium: important, M3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions