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

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   
   - [x] I can reproduce this on the current `master` branch, or I have stated 
the exact version I am running below.
   
   
   ### Studio Version
   
   Branch: `rocketmq-studio`, commit 
`779b8c0e7aed2396d3cc72743dcd544ea48e9ae6`. Reproduced from source in a focused 
frontend component test, not a live deployment.
   
   ### Runtime Environment
   
   Linux cloud workspace; Node.js 24.19.0; repository-pinned Vitest 4.1.10, 
React 18 and Ant Design 5; jsdom. MySQL and a live browser are not required for 
this reproduction.
   
   ### Connected RocketMQ Cluster
   
   No live cluster was used. Ordinary API/service boundaries return controlled 
responses; the actual page, modal/drawer, filters and pagination are rendered. 
No real credentials or customer data were used.
   
   ### Build Toolchain
   
   _No response_
   
   ### Describe the Bug
   
   A selected-message resend captures the message drawer's page and page size 
when it starts. Pagination remains usable while the resend runs. When the 
resend finishes, it starts a newer read for that old page, replacing a page the 
operator has since opened.
   
   Because `loadDetailMessages` assigns a fresh request generation, the 
existing stale-read guard treats this obsolete refresh as the newest request. A 
page-size change can also produce a response fetched with the old size under 
the new page-size selection.
   
   ### Steps to Reproduce
   
   1. Open a DLQ group's message drawer with at least two pages.
   2. Select a message on page 1 and start selected-message resend; keep the 
mutation pending.
   3. Navigate to page 2 and allow its correct response to render.
   4. Complete the pending page-1 resend.
   
   ### What Did You Expect to See?
   
   The completed mutation refreshes the drawer's currently selected query, 
keeping page 2 and its page size. Existing guards must still prevent old 
instance/group/dismissed drawer completions from affecting a new scope.
   
   ### What Did You See Instead?
   
   The completion re-requests page 1, replaces page-2 rows and switches the 
displayed page back to 1. This interrupts inspection and discards the 
operator's newer context.
   
   ### Additional Context
   
   ### Evidence
   
   - [Resend 
continuation](https://github.com/apache/rocketmq-dashboard/blob/779b8c0e7aed2396d3cc72743dcd544ea48e9ae6/web/src/pages/instance/dlq.tsx#L421-L456)
 captures `detailPage` / `detailPageSize` at lines 429-430 and reloads them at 
line 446.
   - [Drawer 
pagination](https://github.com/apache/rocketmq-dashboard/blob/779b8c0e7aed2396d3cc72743dcd544ea48e9ae6/web/src/pages/instance/dlq.tsx#L1006-L1024)
 remains enabled and can update the query while the resend is pending.
   - [Detail 
loading](https://github.com/apache/rocketmq-dashboard/blob/779b8c0e7aed2396d3cc72743dcd544ea48e9ae6/web/src/pages/instance/dlq.tsx#L384-L418)
 advances the read generation and writes the captured page on success.
   
   A new real-component regression returns full coherent 20-row pages with 
total 40, starts a deferred selected resend, loads page 2 through the actual 
pagination control, then resolves the resend. On unchanged production the 
assertion fails because the final request is for page 1 rather than page 2; the 
failure is an assertion on the obsolete request, not a test timeout.
   
   ### Related Work / Scope
   
   - [#4487](https://github.com/apache/rocketmq-dashboard/pull/4487) guards 
instance/group/drawer changes. Its diff was inspected; changing the page inside 
the same open drawer does not invalidate the resend generation.
   - [#6099](https://github.com/apache/rocketmq-dashboard/pull/6099) clamps an 
out-of-range page when totals shrink. Its current diff still reloads the page 
captured by resend; this reproduction keeps total 40 and page 2 remains valid 
throughout.
   - [#5293](https://github.com/apache/rocketmq-dashboard/pull/5293) snapshots 
the drawer's time range; it does not follow current pagination after a mutation.
   
   The proposed fix concerns the read performed after a selected resend, not 
the resend payload or side effects.
   
   ### Verification Scope
   
   Red-only reproductions on unchanged production: `npm test -- --maxWorkers=1 
src/pages/instance/__tests__/InstancePage.test.tsx 
src/pages/instance/__tests__/DLQPage.test.tsx 
src/pages/studio/__tests__/LiteTopic.test.tsx -t 'Test$'` ran the three new 
cases: three expected assertion failures, 74 existing cases skipped. This is 
not a full-suite or real-broker result. Production has not been changed yet.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.


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