zjncs opened a new issue, #5607:
URL: https://github.com/apache/rocketmq-dashboard/issues/5607

   ## Description
   
   The repo has an established convention for paginated lists — when a page 
query returns `items.length === 0 && total > 0 && page > 1`, the page is reset 
to the last valid page and re-queried, with comments naming it a deliberate 
policy (alerts.tsx:375-381: "A deletion (or filter change) can leave the 
current page past the last valid one. Re-query the final page instead of 
rendering a permanently empty table, matching the audit page's clamp"). It is 
implemented in 8 places: alerts, audit, acl, UserManagement, topic, consumer, 
settings/DataSourceTab, settings/CloudCredentialTab.
   
   `notificationDeliveries.tsx` is the sole paginated ops list **without** the 
clamp — its load effect (lines 137-154) stores the empty result unconditionally:
   
   ```ts
   .then((result) => {
       if (cancelled) return;
       setItems(result.items);
       setTotal(result.total);
   })
   ```
   
   ## Impact
   
   Delivered notification records are cleaned up server-side, so the result set 
shrinks under the user. Anyone on page 2+ when that happens gets a 
**permanently empty table** while the pagination still shows "Total 5" with 
page 2 active — the view reads as "no deliveries" and never self-recovers.
   
   Failing test on master (deterministic, no timers): first load returns 21 
items/total 21, click page 2, the page-2 response returns `{items: [], total: 
5}` — no clamp refetch is fired (`expected last call to have been called with 
[ObjectContaining {"page": 1}]`).
   
   ## Expected behavior
   
   Apply the same clamp as the other 8 pages: re-query the last valid page 
instead of storing the empty result.
   
   ## Environment
   
   - branch: master (0228dad5)
   - file: `web/src/pages/ops/notificationDeliveries.tsx` (load effect at 
~137-154)


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