Skip to content

fix(objectql): honor $searchFields override sent as a comma-string (ADR-0061)#2159

Merged
xuyushun441-sys merged 1 commit into
mainfrom
fix/search-fields-override
Jun 22, 2026
Merged

fix(objectql): honor $searchFields override sent as a comma-string (ADR-0061)#2159
xuyushun441-sys merged 1 commit into
mainfrom
fix/search-fields-override

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

The $searchFields override (the view-level 'narrow search to these fields' signal list views send) arrives over REST/OData as a comma-separated STRING ('name,industry'), not an array. The engine only applied it when Array.isArray was true, so it was a silent no-op — search=tech&searchFields=name still searched the default fields. Coerce a string requestedFields to an array in resolveSearchFields (single seam); engine.find passes the raw value through. Verified e2e over HTTP: search 'tech' with searchFields=name → only Initech (name); searchFields=industry → the 4 Technology accounts (label→value). Unit test added. Pairs with #2134/#2142 and objectui #1872; closes the override path of ADR-0061 D1.

…DR-0061)

The $searchFields override (the view-level "narrow search to these fields"
signal that list views send) arrives over the REST/OData path as a URL query
param — i.e. a comma-separated STRING ("name,industry"), not an array. The
engine only applied it when Array.isArray was true, so the override was a
silent no-op: `search=tech&searchFields=name` still searched the default field
set instead of just `name`.

Coerce a string `requestedFields` to an array in resolveSearchFields (the single
seam), and pass the raw value through from engine.find. Now
`searchFields=name` narrows to the name field, `searchFields=industry` to
industry (matched via option label→value), as intended.

Verified end-to-end over HTTP: search "tech" with searchFields=name → only
Initech (name match); with searchFields=industry → the 4 Technology accounts.
Unit test added for the comma-string form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 22, 2026 2:34am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

14 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/core/services.mdx (via @objectstack/objectql)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/objectql)
  • content/docs/concepts/metadata-lifecycle.mdx (via @objectstack/objectql)
  • content/docs/concepts/packages.mdx (via @objectstack/objectql)
  • content/docs/guides/authentication.mdx (via @objectstack/objectql)
  • content/docs/guides/deployment-vercel.mdx (via @objectstack/objectql)
  • content/docs/guides/formula.mdx (via packages/objectql)
  • content/docs/guides/kernel-services.mdx (via @objectstack/objectql)
  • content/docs/guides/objectql-migration.mdx (via @objectstack/objectql)
  • content/docs/guides/packages.mdx (via @objectstack/objectql)
  • content/docs/guides/plugins.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectos/index.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/objectql)
  • content/docs/releases/v9.mdx (via @objectstack/objectql)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@xuyushun441-sys
xuyushun441-sys merged commit c0b93ba into main Jun 22, 2026
16 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the fix/search-fields-override branch June 22, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants