You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(list,data-objectstack,types): exporting a searched list no longer downloads the unsearched superset (#3078)
The server-streamed export mirrored the view's `filter` and `sort`, and the
code comment claimed that made the file match the screen:
Mirrors the active view's filter + sort so the exported file matches
what the user sees.
It mirrored one half. There was no way to carry the term a user had typed into
the search box — `ExportDownloadRequest` had no field for one — so exporting
during a search produced MORE ROWS than the list showed, in a file that looks
authoritative, with nothing indicating the difference. The client-side fallback
was always correct (it serializes the already-searched `data`); only the server
path was wrong, and it is the one that handles xlsx.
Same family as a dropped filter (objectstack#3948, objectstack#4181): a
plausible answer that is quietly broader than the one asked for.
- `ExportDownloadRequest` gains `search` / `searchFields`.
- `ObjectStackAdapter.exportDownload` sends them as `search=` / `searchFields=`,
trimming the term and omitting both when it is blank (`searchFields` alone
means nothing).
- `ListView` passes the active `searchTerm` and the view's `searchableFields`,
and both are now in the export callback's dependency array — a stale closure
would export the wrong row set.
Requires a server with objectstack#4230. Older servers ignore unknown query
params on this route, so they keep today's behaviour rather than erroring.
Also: the filter merge is no longer written twice. The three filter sources
(view filter, filter-panel group, per-field user filters) were merged by
verbatim copies in the data fetch and in the export — two copies that must
agree, deciding respectively what the user SEES and what they DOWNLOAD. Both
now call `buildEffectiveFilter`.
That half is a PURE EXTRACTION, and the tests say so: the four parity tests
added for it pass against the old duplicated code too. They exist to keep it
that way — the adapter's duplicated filter-shape check had already drifted
apart unnoticed (#3072). The parity tests compare the arguments of the two real
calls rather than asserting an expected AST twice, which would go on passing if
both copies drifted the same wrong way.
Verification: 9 new tests (4 ListView export/search, 4 fetch-vs-export parity,
5 adapter query params). Reverting ListView.tsx fails the 2 search tests and
passes the 4 parity ones; reverting the adapter fails 4. Full suite 758 files /
8819 tests green; tsc clean across types, data-objectstack, plugin-list;
eslint 0 errors.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments