unbridled-41 opened a new issue, #3307:
URL: https://github.com/apache/rocketmq-dashboard/issues/3307

   ## Problem
   
   The topic list's search box trims the term only for the server query. 
`loadTopicPage` fetches with `search: searchText.trim()`, but the client-side 
row filter `visibleTopics` receives the raw input and matches with 
`topic.name.toLowerCase().includes(searchText.toLowerCase())`. A search term 
with leading or trailing whitespace (easy to get from a paste) therefore 
queries the server with the trimmed term, receives the matching topics, then 
filters every returned row out because no topic name contains the padded string 
— the table shows empty despite matches existing.
   
   ## Evidence / source
   
   - Code inspection of the current `rocketmq-studio` branch (base commit 
36126024): `web/src/pages/instance/topic.tsx` — `loadTopicPage` trims (`:433`), 
`filteredTopics` passes the raw `searchText` to `visibleTopics` (`:484`), the 
filter itself at `:178`; `onSearch` stores the raw value (`:1464-1467`).
   - Deterministic Vitest reproduction in `TopicPage.test.tsx`: `keeps matching 
rows when the search term has leading or trailing spaces` fails on the unfixed 
source (the matching row disappears after submitting " orders ").
   
   ## Impact
   
   The primary search interaction on the topic page returns an empty table for 
padded input, even though the server returned matching topics.
   
   ## Expected behavior / acceptance criteria
   
   - The trimmed search term is used consistently by the server query, the 
client-side row filter, and the export, so rows matching the trimmed term 
remain visible.
   - Regression coverage for a padded search term; it must fail on the unfixed 
code.
   
   ## Related work
   
   - #911 (closed) fixed the same defect class for consumer-group search; the 
topic page retains the trim mismatch.
   
   ## PR
   
   PR #3301 (includes the fix and the regression test).
   


-- 
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]

Reply via email to