Commit c0b93ba
fix(objectql): honor $searchFields override sent as a comma-string (ADR-0061) (#2159)
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: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent d5f6d29 commit c0b93ba
3 files changed
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1916 | 1916 | | |
1917 | 1917 | | |
1918 | 1918 | | |
1919 | | - | |
| 1919 | + | |
1920 | 1920 | | |
1921 | 1921 | | |
1922 | 1922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | | - | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
0 commit comments