fix(objectql): honor $searchFields override sent as a comma-string (ADR-0061)#2159
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 14 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.