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

   ### Before Creating the Bug Report
   
   - [x] Searched issues and PRs for metrics history, clearing and pending 
queries.
   - [x] This is a RocketMQ Studio frontend defect.
   - [x] Reproduced on current rocketmq-studio source.
   
   ### Studio Version
   
   rocketmq-studio@779b8c0e7aed2396d3cc72743dcd544ea48e9ae6, source checkout.
   
   ### Runtime Environment
   
   Linux, Node.js 22.20.0, locked Vitest/jsdom dependencies. Reproduced with 
the actual MetricsExplorer component and controlled metrics API responses; no 
live browser deployment or database was used.
   
   ### Connected RocketMQ Cluster
   
   Not required. Synthetic Prometheus matrices are returned by deferred API 
mocks; no broker or external metrics endpoint is contacted.
   
   ### Describe the Bug
   
   Clear history removes existing entries from both the drawer and 
localStorage, but a query started before clearing can complete later and 
immediately restore its old entry. This happens for both profile-panel 
refreshes and custom PromQL requests. Chart request generations do not change 
when history is cleared, and their success callbacks unconditionally merge and 
persist history.
   
   ### Steps to Reproduce
   
   1. Load Metrics Explorer successfully, producing one history entry.
   2. Start a profile refresh or a custom query and hold its response pending.
   3. Open Query history and click Clear history. The drawer is empty and the 
history storage key is removed.
   4. Complete the pending successful response.
   5. The cleared drawer contains one entry again and history is persisted 
again, without a new query after clearing.
   
   ### What Did You Expect to See?
   
   Queries started before Clear history should not restore cleared history. 
They may still complete and update their charts. Queries started after clearing 
should be recorded normally.
   
   ### What Did You See Instead?
   
   Both real-component regression cases fail against unchanged production: the 
drawer was expected to have zero list items after the old response, but 
contains one. The chart completion succeeds in both cases.
   
   Focused reproduction: `cd web && npm test -- 
src/components/__tests__/MetricsExplorer.test.tsx -t 
doesNotRestoreClearedHistory` (2 failures, 39 skipped).
   
   ### Additional Context
   
   #6359 / #6377 concerns ordering and retention when successful requests 
finish out of order; it does not handle an explicit Clear history action. #5982 
/ #5983 concerns account scoping, not late request repopulation. The proposed 
correction adds a history-only generation guard, leaving chart generations and 
ongoing query completion intact. New post-clear queries remain eligible for 
history.
   
   AI assistance was used for investigation and reproduction. No live incident 
or maintainer review is claimed.
   
   ### Are You Willing to Submit a Pull Request?
   
   Yes.
   


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