chstercc opened a new pull request, #6394:
URL: https://github.com/apache/rocketmq-dashboard/pull/6394

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6393
   
   ### Brief Description
   
   Clearing Metrics Explorer history previously removed its rows only until a 
pending query completed: an earlier profile refresh or custom query would merge 
and persist its old entry again.
   
   Capture a separate history generation at query start and advance it on Clear 
history. Obsolete requests still update their charts, but skip history 
publication. Keep the check inside the state updater so a deferred updater also 
observes a later clear action. Post-clear requests continue recording history 
normally.
   
   Add three real-component regressions covering profile/custom completions 
after clearing, continued chart rendering and new-query recording, and 
preservation of a new custom entry when an older independent profile query 
completes.
   
   AI assistance was used for investigation, implementation and validation; the 
final diff was reviewed. Only the explorer and its component tests change.
   
   ### How Did You Test This Change?
   
   Validated on upstream 
rocketmq-studio@779b8c0e7aed2396d3cc72743dcd544ea48e9ae6 with Linux Node.js 
22.20.0 and locked frontend dependencies.
   
   - Before the fix, both profile/custom clear-history regressions fail on the 
reappearing list row (2 failures, 39 skipped).
   - `cd web && npm test -- src/components/__tests__/MetricsExplorer.test.tsx 
-t 'doesNotRestoreClearedHistory|keepsPostClearHistory'`: 3 passed, 39 skipped.
   - `cd web && npm test`: 159 files passed, 1607 tests passed.
   - `cd web && npm run lint`: passed with 0 errors and 10 existing warnings in 
unchanged files. Final changed-file ESLint also passed.
   - `cd web && npm run build`: passed, including TypeScript, Vite and license 
verification (133 actual components, 140 license files).
   - Prettier checks for both changed files and `git diff --check`: passed.
   
   The component regressions use the real editor/drawer and mocked metrics APIs 
with deferred synthetic results; no live broker, database or browser 
integration was exercised. Backend/ArchUnit tests were not run for this 
frontend-only change.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [x] Tests added for non-trivial changes, new descriptions end in Test
   - [x] New UI text has both Chinese and English entries — no new UI text
   - [ ] Architecture constraints stay green — backend/ArchUnit not run
   - [x] New source files carry the ASF license header — no new files; existing 
headers retained
   - [ ] Documentation touched where behaviour changed — no documentation 
changes; regression tests describe the clear-history behavior
   


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