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

   ### Studio Version
   
   branch: `master`
   git commit id: `d50ffecc9d7e8f8f46da64198831bd7952e6974e`
   deployed as: built from source (dev profile)
   
   ### Runtime Environment
   
   Ubuntu (WSL2), Node 24, Chrome; reproducible via the page's Vitest suite.
   
   ### Connected RocketMQ Cluster
   
   Not required — the defect is pure client-side pagination state after a bulk 
delete.
   
   ### Describe the Bug
   
   On `/ops/alerts`, after a successful bulk delete the page steps back one 
page whenever every rule on the current page was deleted — regardless of 
whether enough rules remain to fill that page:
   
   `web/src/pages/ops/alerts.tsx:615-618` (inside `handleBulkDelete`):
   
   ```tsx
   if (succeeded.size > 0) {
     if (rules.length === succeeded.size && page > 1) setPage((current) => 
current - 1);
     else refreshRules();
   }
   ```
   
   `rules.length === succeeded.size` means "the selected rules filled the 
current page", not "the current page is now empty". The single-row delete right 
above uses the correct condition (`rules.length === 1 && page > 1`, line 541), 
and `systemAlerts.tsx` silence deletion likewise checks `silences.length === 1`.
   
   ### Steps to Reproduce
   
   1. Have more rules than one page holds (e.g. 45 rules, page size 20).
   2. Go to page 3, select all rows on that page (5 rows), delete them in bulk.
   3. All succeed.
   
   ### What Did You Expect to See?
   
   The page stays on page 3 (refreshed), because 40 rules still remain and page 
3 is still a valid page.
   
   ### What Did You See Instead?
   
   `rules.length (5) === succeeded.size (5)` holds, so the page jumps back to 
page 2 — the operator loses their place and the table silently re-queries the 
previous page.
   
   With exactly one page of data (e.g. 3 rules on page 2 of 2 pages, all 
deleted) the same branch happens to do the right thing, which is why the bug 
only shows when a full page is deleted while more data remains.
   
   ### Additional Context
   
   A Vitest regression that renders the alerts page with more than one page of 
rules, bulk-deletes all rows of the last page and asserts the table re-queries 
the same page fails on unmodified `master` (the list request is issued for page 
− 1 instead).
   
   AI-assisted source audit; the fail-before test was executed locally with 
Node 24.
   


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