unbridled-41 opened a new issue, #4262: URL: https://github.com/apache/rocketmq-dashboard/issues/4262
[Studio][Bug] User inventory CSV export uses the live search input instead of the committed query ## Problem The studio user management page loads its table from a debounced (committed) search, but the "导出" (export) button builds its query from the **live** input value. Typing a refinement and clicking export within the 300 ms debounce window (or while the matching refetch is still in flight) downloads a CSV for a search the displayed table never showed. ## Evidence - `web/src/pages/studio/UserManagement.tsx` at 6c24d2ed: the table fetch uses `search: debouncedSearch || undefined` (line 134, fed by the debounce effect at lines 114-117), while `handleExportUsers` sends `search: search.trim() || undefined` (line 268) with the live `search` in its dependency array (line 282). - Regression test red on current code: after the debounce settles on `alpha`, typing `-beta` and immediately clicking export makes the export API receive `search: "alpha-beta"` while the table still shows the `alpha` results. The export callback also resolves with whatever the live state is at click time, so an in-flight refetch is bypassed the same way. - Sibling pages already do this correctly - `ops/audit.tsx` exports from `debouncedSearchText`, `settings/CloudCredentialTab.tsx` and `settings/DataSourceTab.tsx` export from their `debouncedSearch` - so the user inventory export is the odd one out. ## Impact The exported user inventory is the audit/compliance artifact of this page; with the bug it can silently contain rows for a query the operator never saw displayed (e.g. a typo still in the input, or a term the debounced fetch has not committed yet). ## Expected behavior The export should use the committed (debounced) search value - the same query the visible table was loaded with - mirroring the sibling pages and the committed-query semantics already established on the message page. ## Related work - #4009 / merged fix established "act against the committed query, not live inputs" for the message page pagination; this is the export-side twin on the user inventory page. ## PR Fix incoming. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
