Repository navigation
fix(studio): export users against the committed search term - #4263
Closed
unbridled-41 wants to merge 1 commit into
Closed
unbridled-41 wants to merge 1 commit into
unbridled-41 wants to merge 1 commit into
Conversation
The user inventory table loads from the debounced (committed) search, but `handleExportUsers` rebuilt its query from the live input value. Typing a refinement and clicking export within the 300 ms debounce window downloaded a CSV for a search the displayed table never showed - and an in-flight refetch was bypassed the same way. The export now sends `debouncedSearch`, the same value the visible table was loaded with, matching how the audit, cloud credential and data source pages already scope their exports. Regression test: commits a search, refines the input, and exports inside one synchronous block so the debounce cannot commit in between; the export request must still carry the committed term.
Contributor
Author
Verification evidence
|
RockteMQ-AI
approved these changes
Sep 13, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
LGTM — code changes look good.
Automated review by github-manager-bot
lizhimins
pushed a commit
that referenced
this pull request
Sep 16, 2026
#4331) Incorporates ten related front-end fixes from the same author: - #4175 render the rule last-triggered time as UTC - #4189 keep the selected range when the metrics instance changes - #4245 reload the paginated group list after creating groups - #4249 edit topic configuration from the topic page - #4254 reset the silence form when the maintenance dialog is dismissed - #4263 export users against the committed search term - #4265 re-run the custom query when the dashboard instance changes - #4283 reset the queue browser pull indicators when the queue list reloads - #4285 surface the validation reason when a silence cannot be built - #4322 invalidate the in-flight connection query when the topic changes
Member
|
Merged as part of #4331 — squashed into Your change here (exporting users against the committed search term) is included. We grouped 11 of your related front-end fixes into a single commit so the history stays reviewable; the other PRs in the group are closed with the same note. Everything was cherry-picked onto the current baseline with you kept as the author, and your tests came along with the change. Thanks for the consistently well-tested patches. |
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.
Fixes #4262.
Problem / Evidence
The studio user inventory loads its table from a debounced (committed) search (
listStudioUsersreceivessearch: debouncedSearch || undefined, UserManagement.tsx:134), but the "导出" (export) button rebuilt its query from the live input value (search: search.trim() || undefined, UserManagement.tsx:268, with the livesearchin its dependency array at line 282). Typing a refinement and clicking export within the 300 ms debounce window - or while the matching refetch is still in flight - downloaded a CSV for a search the displayed table never showed.Regression test red on 6c24d2e: after the debounce settles on
alpha, refining the input toalpha-betaand exporting synchronously makes the export API receivesearch: "alpha-beta"while the table still shows thealpharesults. Sibling pages already do this correctly:ops/audit.tsxexports fromdebouncedSearchText,settings/CloudCredentialTab.tsxandsettings/DataSourceTab.tsxfrom theirdebouncedSearch.Root cause / Fix
handleExportUsersnow sendssearch: debouncedSearch || undefined- the committed value the visible table was loaded with - and readsdebouncedSearch(instead ofsearch) in its dependency array. This is the export-side twin of the committed-query semantics established by #4005 for the message page pagination.Priority & scoring
PRIORITY 70 = 影响 26(导出物是本页的审计/清单工件,内容与用户所见列表不一致且静默发生)+ 波及 11(仅本页导出按钮)+ 可复现 18(防抖窗口内"输入→导出"是常规操作序列,确定性复现)+ 维护价值 15(#4005 既有语义的导出孪生,三个兄弟页已正确,一致性收敛)。FIX_CONFIDENCE 95:单值替换 + 依赖数组同步,行为由兄弟页与既有测试共同锚定。
Tests
UserManagementPage > exports users matching the committed search, not live inputis deterministic: after the committed search is awaited, the refinement and the export click run inside one synchronousactblock so the 300 ms debounce cannot commit in between (a first draft that raced the real 300 ms timer proved load-fragile under the full suite and was rewritten before commit). Red on unfixed code (Tests run: 7, 1 failed- export receivedalpha-beta) and green after the fix (7 passed), verified by stashing the fix.UserManagement.test.tsx7/7 passed (re-run after the lint-staged reformat).npx vitest run): 982 tests, 979 passed, 3 failures - all in untouched files from the known load-fragile family (MetricsExplorer.test.tsx×1,ConsumerPage.test.tsx×2); both files pass isolated (25/25 and 31/31). My test passes in the full run.tsc -bclean,eslintclean on both touched files,npm run buildsucceeds (built in 9.67s).Risk
Low: one-value change scoped to the export handler; filtering semantics (
admin/enabled) untouched. Users who typed a new term and waited for the table to refresh see identical behavior; only the stale-window export changes, from "unseen query" to "displayed query".